Fix bug #73150: missing NULL check in dom_document_save_html

(cherry picked from commit 1c0e9126fb)
This commit is contained in:
Stanislav Malyshev 2016-09-25 21:25:01 -07:00 committed by Anatol Belski
parent 4d11a8eedf
commit d1e878f272

View file

@ -1663,7 +1663,7 @@ PHP_FUNCTION(dom_document_savexml)
if (options & LIBXML_SAVE_NOEMPTYTAG) { if (options & LIBXML_SAVE_NOEMPTYTAG) {
xmlSaveNoEmptyTags = saveempty; xmlSaveNoEmptyTags = saveempty;
} }
if (!size) { if (!size || !mem) {
RETURN_FALSE; RETURN_FALSE;
} }
RETVAL_STRINGL((char *) mem, size); RETVAL_STRINGL((char *) mem, size);
@ -2215,7 +2215,7 @@ PHP_FUNCTION(dom_document_save_html)
#else #else
htmlDocDumpMemory(docp, &mem, &size); htmlDocDumpMemory(docp, &mem, &size);
#endif #endif
if (!size) { if (!size || !mem) {
RETVAL_FALSE; RETVAL_FALSE;
} else { } else {
RETVAL_STRINGL((const char*) mem, size); RETVAL_STRINGL((const char*) mem, size);