com php-src: Minor typo in warning message: ext/zlib/tests/dict ionary_usage.phpt ext/zlib/zlib.c
| From: | Bob Weinand | Date: | Fri, 15 May 2015 00:42:11 +0000 |
| Subject: | com php-src: Minor typo in warning message: ext/zlib/tests/dict ionary_usage.phpt ext/zlib/zlib.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86770@lists.php.net to get a copy of this message | ||
Commit: 00ea48ad43122c67c904965d4c315237740685ea
Author: Bob Weinand <bobwei9@hotmail.com> Fri, 15 May 2015 02:42:11 +0200
Parents: 227a21b297c73f09e15e72a80c21254554d49d66
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=00ea48ad43122c67c904965d4c315237740685ea
Log:
Minor typo in warning message
Changed paths:
M ext/zlib/tests/dictionary_usage.phpt
M ext/zlib/zlib.c
Diff:
diff --git a/ext/zlib/tests/dictionary_usage.phpt b/ext/zlib/tests/dictionary_usage.phpt
index b73cd52..8ffa9e8 100644
--- a/ext/zlib/tests/dictionary_usage.phpt
+++ b/ext/zlib/tests/dictionary_usage.phpt
@@ -21,5 +21,5 @@ var_dump(inflate_add($r, $a, ZLIB_FINISH));
string(%d) "%s"
string(6) "abdcde"
-Warning: inflate_add(): dictionary does match expected dictionary (incorrect adler32 hash) in %s on
line %d
+Warning: inflate_add(): dictionary does not match expected dictionary (incorrect adler32 hash) in
%s on line %d
bool(false)
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index f09ba00..31fe18d 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -775,6 +775,8 @@ static zend_bool zlib_create_dictionary_string(HashTable *options, char **dict,
zend_string **end, **ptr = strings - 1;
ZEND_HASH_FOREACH_VAL(dictionary, cur) {
+ int i;
+
*++ptr = zval_get_string(cur);
if (!*ptr || (*ptr)->len == 0) {
if (*ptr) {
@@ -787,6 +789,16 @@ static zend_bool zlib_create_dictionary_string(HashTable *options, char **dict,
php_error_docref(NULL, E_WARNING, "dictionary entries must be non-empty strings");
return 0;
}
+ for (i = 0; i < (*ptr)->len; i++) {
+ if ((*ptr)->val[i] == 0) {
+ do {
+ efree(ptr);
+ } while (--ptr >= strings);
+ efree(strings);
+ php_error_docref(NULL, E_WARNING, "dictionary entries must not contain a
NULL-byte");
+ return 0;
+ }
+ }
*dictlen += (*ptr)->len + 1;
} ZEND_HASH_FOREACH_END();
@@ -950,7 +962,7 @@ PHP_FUNCTION(inflate_add)
php_ctx->inflateDict = NULL;
break;
case Z_DATA_ERROR:
- php_error_docref(NULL, E_WARNING, "dictionary does match expected dictionary (incorrect
adler32 hash)");
+ php_error_docref(NULL, E_WARNING, "dictionary does not match expected dictionary
(incorrect adler32 hash)");
efree(php_ctx->inflateDict);
zend_string_release(out);
php_ctx->inflateDict = NULL;