SF Bug Tracker id 3175217 - Crash bug in Parser_addNamespace()

(This is a fix to commit 86bef09787)
(cherry picked from commit ad7272d2b5)
This commit is contained in:
Marcelo Roberto Jimenez 2012-03-13 10:47:57 -03:00
parent 5cc904a852
commit 24cf7c2a55

View File

@ -1517,9 +1517,9 @@ static int Parser_addNamespace(
}
xmlParser->pNeedPrefixNode = NULL;
} else {
if (pCur->prefix &&
(strcmp(pNode->nodeName, pCur->element) != 0) &&
(strcmp(pNode->prefix, pCur->prefix) != 0))
if (!pCur->prefix ||
((strcmp(pNode->nodeName, pCur->element) != 0) &&
(strcmp(pNode->prefix, pCur->prefix) != 0)))
return IXML_FAILED;
namespaceUri = Parser_getNameSpace(xmlParser, pCur->prefix);
if (namespaceUri) {