com php-src: Fix bug #71629: sync php_url_decode definiti on: NEWS main/streams/memory.c
| From: | Stanislav Malyshev | Date: | Mon, 22 Feb 2016 01:11:34 +0000 |
| Subject: | com php-src: Fix bug #71629: sync php_url_decode definiti on: NEWS main/streams/memory.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91121@lists.php.net to get a copy of this message | ||
Commit: d25e67eee653c8ce8ce1a4459181e3b802eb915c
Author: Stanislav Malyshev <stas@php.net> Sun, 21 Feb 2016 17:02:55 -0800
Parents: 0bd64b50b88d243cf337e0c5dbea20e4ba809117
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d25e67eee653c8ce8ce1a4459181e3b802eb915c
Log:
Fix bug #71629: sync php_url_decode definition
Bugs:
https://bugs.php.net/71629
Changed paths:
M NEWS
M main/streams/memory.c
Diff:
diff --git a/NEWS b/NEWS
index 0cd6c4b..4688f14 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP NEWS
?? ??? 2016 PHP 7.0.5
- Core:
+ . Fixed bug #71629 (Out-of-bounds access in php_url_decode in context
+ php_stream_url_wrap_rfc2397). (mt at debian dot org)
. Fixed bug #71622 (Strings used in pass-as-reference cannot be used to
invoke C::$callable()). (Bob)
. Fixed bug #71596 (Segmentation fault on ZTS with date function
diff --git a/main/streams/memory.c b/main/streams/memory.c
index 09da047..56ffe34 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -22,7 +22,7 @@
#include "php.h"
#include "ext/standard/base64.h"
-PHPAPI int php_url_decode(char *str, int len);
+PHPAPI size_t php_url_decode(char *str, size_t len);
/* Memory streams use a dynamic memory buffer to emulate a stream.
* You can use php_stream_memory_open to create a readonly stream
@@ -730,7 +730,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
ilen = (int)ZSTR_LEN(base64_comma);
} else {
comma = estrndup(comma, dlen);
- dlen = php_url_decode(comma, (int)dlen);
+ dlen = php_url_decode(comma, dlen);
ilen = (int)dlen;
}