com php-src: Fix bug #73150: missing NULL check in dom_docume nt_save_html: ext/dom/document.c
| From: | Stanislav Malyshev | Date: | Mon, 26 Sep 2016 04:25:01 +0000 |
| Subject: | com php-src: Fix bug #73150: missing NULL check in dom_docume nt_save_html: ext/dom/document.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94928@lists.php.net to get a copy of this message | ||
Commit: 1c0e9126fbfb7fde3173347b7464237f56c38bfa
Author: Stanislav Malyshev <stas@php.net> Sun, 25 Sep 2016 21:25:01 -0700
Parents: 0e6fe3a4c96be2d3e88389a5776f878021b4c59f
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1c0e9126fbfb7fde3173347b7464237f56c38bfa
Log:
Fix bug #73150: missing NULL check in dom_document_save_html
Bugs:
https://bugs.php.net/73150
Changed paths:
M ext/dom/document.c
Diff:
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);