Fixed a crash

This commit is contained in:
Zane U. Ji 2013-10-15 19:19:40 +08:00
parent 8d041e9433
commit af3e0d751a
1 changed files with 8 additions and 2 deletions

View File

@ -69,7 +69,13 @@ InputSource *XercesCatalogResolver::resolveEntity (
#endif #endif
*/ */
if ( publicID == NULL || *publicID == '\0' )
return NULL;
char *narrowPublicId = XMLString::transcode ( publicID ); char *narrowPublicId = XMLString::transcode ( publicID );
if ( narrowPublicId == NULL )
return NULL;
std::string resolved; std::string resolved;
resolved = lookupPublicId ( narrowPublicId ); resolved = lookupPublicId ( narrowPublicId );
@ -80,7 +86,7 @@ InputSource *XercesCatalogResolver::resolveEntity (
XMLCh *wideResolved = XMLString::transcode ( resolved.c_str() ); XMLCh *wideResolved = XMLString::transcode ( resolved.c_str() );
InputSource *source = (InputSource *)new LocalFileInputSource ( wideResolved ); InputSource *source = (InputSource *)new LocalFileInputSource ( wideResolved );
XMLString::release ( &wideResolved ); XMLString::release ( &wideResolved );
return source; return source;