-
-
Save anonymous/2aeeeff7776f2edb701c7a350e66d181 to your computer and use it in GitHub Desktop.
Patch for 73150
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 1c0e9126fbfb7fde3173347b7464237f56c38bfa | |
Author: Stanislav Malyshev <stas@php.net> | |
Date: Sun Sep 25 21:25:01 2016 -0700 | |
Fix bug #73150: missing NULL check in dom_document_save_html | |
diff --git a/ext/dom/document.c b/ext/dom/document.c | |
index d33aaf1..1970c38 100644 | |
--- a/ext/dom/document.c | |
+++ b/ext/dom/document.c | |
@@ -1792,7 +1792,7 @@ PHP_FUNCTION(dom_document_savexml) | |
if (options & LIBXML_SAVE_NOEMPTYTAG) { | |
xmlSaveNoEmptyTags = saveempty; | |
} | |
- if (!size) { | |
+ if (!size || !mem) { | |
RETURN_FALSE; | |
} | |
RETVAL_STRINGL(mem, size, 1); | |
@@ -2327,7 +2327,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, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment