mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-26 00:37:43 +03:00
Fix a potential NULL dereference
For https://bugzilla.gnome.org/show_bug.cgi?id=733040 xmlDictLookup() may return NULL in case of allocation error, though very unlikely it need to be checked.
This commit is contained in:
6
parser.c
6
parser.c
@@ -9316,6 +9316,12 @@ reparse:
|
|||||||
const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len);
|
const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len);
|
||||||
xmlURIPtr uri;
|
xmlURIPtr uri;
|
||||||
|
|
||||||
|
if (URL == NULL) {
|
||||||
|
xmlErrMemory(ctxt, "dictionary allocation failure");
|
||||||
|
if ((attvalue != NULL) && (alloc != 0))
|
||||||
|
xmlFree(attvalue);
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
if (*URL != 0) {
|
if (*URL != 0) {
|
||||||
uri = xmlParseURI((const char *) URL);
|
uri = xmlParseURI((const char *) URL);
|
||||||
if (uri == NULL) {
|
if (uri == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user