From: Antony Dovgal Date: Mon, 26 Mar 2007 10:23:50 +0000 (+0000) Subject: fix #40915 (addcslashes unexpected behavior with binary input) X-Git-Tag: RELEASE_1_1_0~110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9b1ff5080edaa4c19d8324734c3e272abf0b032;p=php fix #40915 (addcslashes unexpected behavior with binary input) --- diff --git a/ext/standard/string.c b/ext/standard/string.c index b4398818ea..e7102d0b03 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4555,8 +4555,8 @@ PHP_FUNCTION(addcslashes) RETURN_STRINGL(str, str_len, 1); } - RETURN_STRING(php_addcslashes(str, str_len, &Z_STRLEN_P(return_value), 0, - what, what_len TSRMLS_CC), 0); + Z_STRVAL_P(return_value) = php_addcslashes(str, str_len, &Z_STRLEN_P(return_value), 0, what, what_len TSRMLS_CC); + RETURN_STRINGL(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value), 0); } /* }}} */ diff --git a/ext/standard/tests/strings/bug40915.phpt b/ext/standard/tests/strings/bug40915.phpt new file mode 100644 index 0000000000..854853ed2e Binary files /dev/null and b/ext/standard/tests/strings/bug40915.phpt differ