Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
None
-
None
-
None
-
Operating System: Other
Platform: All
-
14265
Description
This problem exists in nightly build 2002-10-25-win32 and released version 2.1.
The 1.9 Revision of DTD\DTDScanner.cpp addresses a problem with systemId and
publicId described as 'Fix: public id / system id in entity decl should be null
if empty'. The code is shown below:-
// Fill in the id fields of the decl with the info we got
const XMLCh* publicId = bbPubId.getRawBuffer();
const XMLCh* systemId = bbSysId.getRawBuffer();
decl.setPublicId((*publicId) ? publicId : 0);
decl.setSystemId((*systemId) ? systemId : 0);
----> decl.setBaseURI((*lastInfo.systemId) ? lastInfo.systemId : 0);
The problem is that in my test case although bbPubId.getRawBuffer() and
bbSysId.getRawBuffer() return a pointer to an empty string which allows the
test '((*publicId) ? publicId : 0)' to be applied safely the lastInfo.systemId
in the line indicated above with ----> contains a null pointer and hence the
test for *lastInfo.systemId blows up with an access violation. The null pointer
was obtained in ReaderMgr::getLastExtEntityInfo() where lastinfo.sustemId is
assigned, 'lastInfo.SystemId = theReader->getSystemId()'. In my case theReader-
>getSystemId() returned a null pointer. I am trying to isolate a simple test
case for this problem but is should be clear from the example above that the
tests above cannot be safe if there is the possibility of returning a null
pointer.