1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0025770: Possible "invalid memory access"

Memory problems fixed.
This commit is contained in:
aml
2015-01-30 13:13:06 +03:00
committed by bugmaster
parent 0b0320e76e
commit 31e0b8e84c
2 changed files with 4 additions and 3 deletions

View File

@@ -481,8 +481,9 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
new_par.Append(lcons);
New_NCONTROL = new_par.Length() - 1;
//simple protection if New_NCONTROL > allocated elements in array
if (New_NCONTROL > aMaxArraySize) {
// Simple protection if New_NCONTROL > allocated elements in array but one
// aMaxArraySize - 1 index may be filled after projection.
if (New_NCONTROL > aMaxArraySize - 1) {
mySameParameter = Standard_False;
return;
}