summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2016-09-25 21:25:01 -0700
committerAnatol Belski <ab@php.net>2016-10-13 00:30:23 +0200
commit512d3c679d6300765e2c293feb614bae2195d216 (patch)
tree8f58c957261c814671dfed27acaf2eba89d80b41
parent9c675607e60c4ed86ee6772c4376b2f5e30c325b (diff)
downloadphp-git-512d3c679d6300765e2c293feb614bae2195d216.tar.gz
Fix bug #73150: missing NULL check in dom_document_save_html
(cherry picked from commit 1c0e9126fbfb7fde3173347b7464237f56c38bfa) (cherry picked from commit d1e878f2726e65502fdd992c5b57feeada57893f)
-rw-r--r--ext/dom/document.c4
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);