mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-13 08:02:56 +00:00
Validate "parser" and "s" parameters to XML_Parse
This commit is contained in:
parent
b58abe1e92
commit
56c75720c2
1 changed files with 6 additions and 0 deletions
|
@ -1647,6 +1647,12 @@ XML_SetHashSalt(XML_Parser parser,
|
|||
enum XML_Status XMLCALL
|
||||
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
|
||||
{
|
||||
if (parser == NULL)
|
||||
return XML_STATUS_ERROR;
|
||||
if (s == NULL && len != 0) {
|
||||
errorCode = XML_ERROR_INVALID_ARGUMENT;
|
||||
return XML_STATUS_ERROR;
|
||||
}
|
||||
switch (ps_parsing) {
|
||||
case XML_SUSPENDED:
|
||||
errorCode = XML_ERROR_SUSPENDED;
|
||||
|
|
Loading…
Add table
Reference in a new issue