diff options
author | Daniel Veillard <veillard@redhat.com> | 2014-07-14 16:39:50 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2014-07-14 16:39:50 +0800 |
commit | c836ba66e57d4d9f90f1dc7a827625c99622408f (patch) | |
tree | 36c7f29c16b0d0c2f0d80c0055c92114a2f4070f /parser.c | |
parent | 54c4b1aa719beb83d6fa34181d33b5496e26f4da (diff) | |
download | android_external_libxml2-c836ba66e57d4d9f90f1dc7a827625c99622408f.tar.gz android_external_libxml2-c836ba66e57d4d9f90f1dc7a827625c99622408f.tar.bz2 android_external_libxml2-c836ba66e57d4d9f90f1dc7a827625c99622408f.zip |
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.
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -9316,6 +9316,12 @@ reparse: const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len); xmlURIPtr uri; + if (URL == NULL) { + xmlErrMemory(ctxt, "dictionary allocation failure"); + if ((attvalue != NULL) && (alloc != 0)) + xmlFree(attvalue); + return(NULL); + } if (*URL != 0) { uri = xmlParseURI((const char *) URL); if (uri == NULL) { |