Validate parser parameter to XML_GetIdAttributeIndex

This commit is contained in:
Rhodri James 2017-04-25 16:53:33 +01:00 committed by Sebastian Pipping
parent c5baf7e3e4
commit a1feb1da07
2 changed files with 6 additions and 3 deletions

View file

@ -738,9 +738,10 @@ XMLPARSEAPI(int)
XML_GetSpecifiedAttributeCount(XML_Parser parser);
/* Returns the index of the ID attribute passed in the last call to
XML_StartElementHandler, or -1 if there is no ID attribute. Each
attribute/value pair counts as 2; thus this correspondds to an
index into the atts array passed to the XML_StartElementHandler.
XML_StartElementHandler, or -1 if there is no ID attribute or
parser == NULL. Each attribute/value pair counts as 2; thus this
correspondds to an index into the atts array passed to the
XML_StartElementHandler.
*/
XMLPARSEAPI(int)
XML_GetIdAttributeIndex(XML_Parser parser);

View file

@ -1362,6 +1362,8 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser)
int XMLCALL
XML_GetIdAttributeIndex(XML_Parser parser)
{
if (parser == NULL)
return -1;
return idAttIndex;
}