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

0027454: Application hangs while opening a non-OCAF XML file

1) Add protection against accessing null pointer in PCDM_ReadWriter::FileFormat.

2) In LDOM_XmlReader::ReadRecord, take into account that the character '>' can have no special meaning (e.g., in a text), and we must read the data behind this character to complete the current tag reading. This treatment concerns the mode of work when myTagPerStep is true.

3) Create a test case of reading of XML file not related to OCAF document.

Test case was added.
This commit is contained in:
msv
2016-04-29 19:31:13 +03:00
committed by bugmaster
parent 15a954deb5
commit 18151f1aa1
4 changed files with 55 additions and 3 deletions

View File

@@ -166,12 +166,16 @@ TCollection_ExtendedString PCDM_ReadWriter::FileFormat (Standard_IStream& theISt
{
TCollection_ExtendedString aFormat;
Storage_BaseDriver* aFileDriver;
Storage_BaseDriver* aFileDriver = 0L;
if (PCDM::FileDriverType (theIStream, aFileDriver) == PCDM_TOFD_XmlFile)
{
return ::TryXmlDriverType (theIStream);
}
if (!aFileDriver)
{
// type is not recognized, return empty string
return aFormat;
}
aFileDriver->ReadCompleteInfo (theIStream, theData);