mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-08 14:33:43 +00:00
Validate parser parameter to XML_GetIdAttributeIndex
This commit is contained in:
parent
c5baf7e3e4
commit
a1feb1da07
2 changed files with 6 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -1362,6 +1362,8 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser)
|
|||
int XMLCALL
|
||||
XML_GetIdAttributeIndex(XML_Parser parser)
|
||||
{
|
||||
if (parser == NULL)
|
||||
return -1;
|
||||
return idAttIndex;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue