mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
Fix sanity check in htmlParseNameComplex
- (cur - len) can overflow. - Throw an internal error. Fixes bug 780077.
This commit is contained in:
@@ -2528,8 +2528,12 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxt->input->base > ctxt->input->cur - len)
|
if (ctxt->input->cur - ctxt->input->base < len) {
|
||||||
return(NULL);
|
/* Sanity check */
|
||||||
|
htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
|
||||||
|
"unexpected change of input buffer", NULL, NULL);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
|
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user