1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Data Exchange, STP - Crash on empty list (#671)

Added condition to always allocate an array in case of empty list
This commit is contained in:
Pasukhin Dmitry
2025-08-16 09:24:21 +01:00
committed by GitHub
parent ae4de70f98
commit afccf69cb7

View File

@@ -688,7 +688,14 @@ Standard_Boolean StepData_StepReaderData::ReadSubList(const Standard_Integer n
numsub = SubListNumber(num, nump, Standard_False);
if (numsub > 0)
{
return (NbParams(numsub) > 0);
const Standard_Integer aNbParams = NbParams(numsub);
if (aNbParams == 0)
{
Handle(String) anErrMess = new String("Parameter n0.%d (%s) is an empty LIST");
sprintf(txtmes, anErrMess->ToCString(), nump, mess);
ach->AddWarning(txtmes, anErrMess->ToCString());
}
return Standard_True;
}
// Si optionel indefini, on passe l eponge
numsub = 0;