diff options
author | Stanislav Malyshev <stas@php.net> | 2016-09-25 21:25:01 -0700 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-10-12 12:19:41 +0200 |
commit | d1e878f2726e65502fdd992c5b57feeada57893f (patch) | |
tree | fba2b1092cf7cd8f400a0659f8e0372ee268c9b6 /ext/dom | |
parent | 4d11a8eedf976f081dcc1b525c8a79ca18c9d67c (diff) | |
download | php-git-d1e878f2726e65502fdd992c5b57feeada57893f.tar.gz |
Fix bug #73150: missing NULL check in dom_document_save_html
(cherry picked from commit 1c0e9126fbfb7fde3173347b7464237f56c38bfa)
Diffstat (limited to 'ext/dom')
-rw-r--r-- | ext/dom/document.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c index 30d9c13ee9..17ac30a991 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1663,7 +1663,7 @@ PHP_FUNCTION(dom_document_savexml) if (options & LIBXML_SAVE_NOEMPTYTAG) { xmlSaveNoEmptyTags = saveempty; } - if (!size) { + if (!size || !mem) { RETURN_FALSE; } RETVAL_STRINGL((char *) mem, size); @@ -2215,7 +2215,7 @@ PHP_FUNCTION(dom_document_save_html) #else htmlDocDumpMemory(docp, &mem, &size); #endif - if (!size) { + if (!size || !mem) { RETVAL_FALSE; } else { RETVAL_STRINGL((const char*) mem, size); |