Validate parser parameter to XML_GetSpecifiedAttributeCount

This commit is contained in:
Rhodri James 2017-04-25 16:50:15 +01:00 committed by Sebastian Pipping
parent 4c639fc7c0
commit c5baf7e3e4
2 changed files with 3 additions and 1 deletions

View file

@ -732,7 +732,7 @@ XML_GetBase(XML_Parser parser);
to the XML_StartElementHandler that were specified in the start-tag
rather than defaulted. Each attribute/value pair counts as 2; thus
this correspondds to an index into the atts array passed to the
XML_StartElementHandler.
XML_StartElementHandler. Returns -1 if parser == NULL.
*/
XMLPARSEAPI(int)
XML_GetSpecifiedAttributeCount(XML_Parser parser);

View file

@ -1354,6 +1354,8 @@ XML_GetBase(XML_Parser parser)
int XMLCALL
XML_GetSpecifiedAttributeCount(XML_Parser parser)
{
if (parser == NULL)
return -1;
return nSpecifiedAtts;
}