com php-src: Fix #73025: Heap Buffer Overflow in virtual_pope n of zend_virtual_cwd.c: NEWS Zend/zend_virtu al_cwd.c
| From: | Christoph Michael Becker | Date: | Tue, 06 Sep 2016 10:05:58 +0000 |
| Subject: | com php-src: Fix #73025: Heap Buffer Overflow in virtual_pope n of zend_virtual_cwd.c: NEWS Zend/zend_virtu al_cwd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94346@lists.php.net to get a copy of this message | ||
Commit: dad793630d5966a9c22f3fcd7f24b7937bd1a36f
Author: Christoph M. Becker <cmbecker69@gmx.de> Tue, 6 Sep 2016 12:05:22 +0200
Parents: 3a35d43ad9000d1a573d08784aead356e2ae3535
Branches: PHP-5.6 PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=dad793630d5966a9c22f3fcd7f24b7937bd1a36f
Log:
Fix #73025: Heap Buffer Overflow in virtual_popen of zend_virtual_cwd.c
command_length is retrieved via strlen() and later passed to emalloc()
and memcpy(), so the appropriate type is size_t.
We don't add a regression test, because that would need to allocate a string
of at least 2 GiB.
Bugs:
https://bugs.php.net/73025
Changed paths:
M NEWS
M Zend/zend_virtual_cwd.c
Diff:
diff --git a/NEWS b/NEWS
index 2689431..b11b283 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2016, PHP 5.6.27
+- Core:
+ . Fixed bug #73025 (Heap Buffer Overflow in virtual_popen of
+ zend_virtual_cwd.c). (cmb)
+
- Filter:
. Fixed bug #72972 (Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and
FILTER_FLAG_NO_PRIV_RANGE). (julien)
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 5a5bcce..875c8da 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -1896,7 +1896,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
/*
#else /* Unix */
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
{
- int command_length;
+ size_t command_length;
int dir_length, extra = 0;
char *command_line;
char *ptr, *dir;