mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-08 14:33:43 +00:00
Validate parser parameter to XML_SetParamentityParsing
This commit is contained in:
parent
e5430d8a07
commit
2a6ed44fbc
2 changed files with 3 additions and 0 deletions
|
@ -905,6 +905,7 @@ enum XML_ParamEntityParsing {
|
|||
entities is requested; otherwise it will return non-zero.
|
||||
Note: If XML_SetParamEntityParsing is called after XML_Parse or
|
||||
XML_ParseBuffer, then it has no effect and will always return 0.
|
||||
Note: If parser == NULL, the function will do nothing and return 0.
|
||||
*/
|
||||
XMLPARSEAPI(int)
|
||||
XML_SetParamEntityParsing(XML_Parser parser,
|
||||
|
|
|
@ -1618,6 +1618,8 @@ int XMLCALL
|
|||
XML_SetParamEntityParsing(XML_Parser parser,
|
||||
enum XML_ParamEntityParsing peParsing)
|
||||
{
|
||||
if (parser == NULL)
|
||||
return 0;
|
||||
/* block after XML_Parse()/XML_ParseBuffer() has been called */
|
||||
if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue