mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0023909: FPE in BSplSLib::RationalDerivative
Avoid use of array out of its bounds in BSplSLib::RationalDerivative(). In addition, Resource_Manager is fixed to allow saving with empty resource map (test bugs fclasses bug181_1).
This commit is contained in:
parent
e87a5bc65e
commit
174178b9fa
@ -165,17 +165,17 @@ void BSplSLib::RationalDerivative(const Standard_Integer UDeg,
|
|||||||
index_w = iiM1;
|
index_w = iiM1;
|
||||||
|
|
||||||
for (jj = 0 ; jj < MinM1 ; jj++) {
|
for (jj = 0 ; jj < MinM1 ; jj++) {
|
||||||
RArray[index_v] = HomogeneousArray[index_v1]; index_v++; index_v1++;
|
RArray[index_v++] = HomogeneousArray[index_v1++];
|
||||||
RArray[index_v] = HomogeneousArray[index_v1]; index_v++; index_v1++;
|
RArray[index_v++] = HomogeneousArray[index_v1++];
|
||||||
RArray[index_v] = HomogeneousArray[index_v1]; index_v++; index_v1++;
|
RArray[index_v++] = HomogeneousArray[index_v1++];
|
||||||
StoreW[index_w] = HomogeneousArray[index_v1]; index_w++; index_v1++;
|
StoreW[index_w++] = HomogeneousArray[index_v1++];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (jj = MinM1 ; jj < M1 ; jj++) {
|
for (jj = MinM1 ; jj < M1 ; jj++) {
|
||||||
RArray[index_v] = 0.0e0 ; index_v++; index_v1++;
|
RArray[index_v++] = 0.;
|
||||||
RArray[index_v] = 0.0e0 ; index_v++; index_v1++;
|
RArray[index_v++] = 0.;
|
||||||
RArray[index_v] = 0.0e0 ; index_v++; index_v1++;
|
RArray[index_v++] = 0.;
|
||||||
StoreW[index_w] = HomogeneousArray[index_v1]; index_w++; index_v1++;
|
StoreW[index_w++] = 0.;
|
||||||
}
|
}
|
||||||
index_u1 += M4;
|
index_u1 += M4;
|
||||||
index_u += M3;
|
index_u += M3;
|
||||||
@ -186,10 +186,10 @@ void BSplSLib::RationalDerivative(const Standard_Integer UDeg,
|
|||||||
for (ii = MinN1 ; ii < N1 ; ii++) {
|
for (ii = MinN1 ; ii < N1 ; ii++) {
|
||||||
|
|
||||||
for (jj = 0 ; jj < M1 ; jj++) {
|
for (jj = 0 ; jj < M1 ; jj++) {
|
||||||
RArray[index_v] = 0.0e0; index_v++;
|
RArray[index_v++] = 0.0e0;
|
||||||
RArray[index_v] = 0.0e0; index_v++;
|
RArray[index_v++] = 0.0e0;
|
||||||
RArray[index_v] = 0.0e0; index_v++;
|
RArray[index_v++] = 0.0e0;
|
||||||
StoreW[index_w] = 0.0e0; index_w++;
|
StoreW[index_w++] = 0.0e0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ Standard_Boolean Resource_Manager::Save() const
|
|||||||
|
|
||||||
Resource_LexicalCompare Comp;
|
Resource_LexicalCompare Comp;
|
||||||
Standard_Integer NbKey = myUserMap.Extent();
|
Standard_Integer NbKey = myUserMap.Extent();
|
||||||
TColStd_Array1OfAsciiString KeyArray(1,NbKey);
|
TColStd_Array1OfAsciiString KeyArray(1,NbKey+1); // 1 more item is added to allow saving empty resource
|
||||||
Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString Iter(myUserMap);
|
Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString Iter(myUserMap);
|
||||||
|
|
||||||
for ( Index = 1; Iter.More(); Iter.Next())
|
for ( Index = 1; Iter.More(); Iter.Next())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user