summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2014-10-27 19:07:32 -0700
committerStanislav Malyshev <stas@php.net>2014-10-27 19:09:39 -0700
commitc5659cb8bd53ac2fd9952ca7c5445bda8dcaea24 (patch)
tree7b2241e2e90e1ab8c2d7f338017a507a0ed18364
parent0ede82d4665fb0c03ef6cf43bdf05e14f475b230 (diff)
parentdeadeeae1d08877021eb2796aa6790baa74361ed (diff)
downloadphp-git-c5659cb8bd53ac2fd9952ca7c5445bda8dcaea24.tar.gz
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fix bug #68095 - invalid read in php_getopt()
-rw-r--r--NEWS14
-rw-r--r--main/getopt.c8
2 files changed, 16 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 5f9e41d065..2f300b1ea7 100644
--- a/NEWS
+++ b/NEWS
@@ -3,17 +3,19 @@ PHP NEWS
?? ??? 2014, PHP 5.6.3
- Core:
- . Fixed bug #67739 (Windows 8.1/Server 2012 R2 OS build number reported
- as 6.2 (instead of 6.3)). (Christian Wenz)
+ . Implemented 64-bit format codes for pack() and unpack(). (Leigh)
+ . Fixed bug #51800 (proc_open on Windows hangs forever). (Anatol)
. Fixed bug #67633 (A foreach on an array returned from a function not doing
copy-on-write). (Nikita)
- . Fixed bug #51800 (proc_open on Windows hangs forever). (Anatol)
+ . Fixed bug #67739 (Windows 8.1/Server 2012 R2 OS build number reported
+ as 6.2 (instead of 6.3)). (Christian Wenz)
+ . Fixed bug #67949 (DOMNodeList elements should be accessible through
+ array notation) (Florian)
+ . Fixed bug #68095 (AddressSanitizer reports a heap buffer overflow in
+ php_getopt()). (Stas)
. Fixed bug #68118 ($a->foo .= 'test'; can leave $a->foo undefined). (Nikita)
. Fixed bug #68129 (parse_url() - incomplete support for empty usernames
and passwords) (Tjerk)
- . Fixed bug #67949 (DOMNodeList elements should be accessible through
- array notation) (Florian)
- . Implemented 64-bit format codes for pack() and unpack(). (Leigh)
- phpdbg:
. Added XML protocol (-x command line flag). (Bob)
diff --git a/main/getopt.c b/main/getopt.c
index a31a6c75d5..258173fc22 100644
--- a/main/getopt.c
+++ b/main/getopt.c
@@ -59,9 +59,17 @@ PHPAPI int php_getopt(int argc, char* const *argv, const opt_struct opts[], char
{
static int optchr = 0;
static int dash = 0; /* have already seen the - */
+ static char **prev_optarg = NULL;
php_optidx = -1;
+ if(prev_optarg && prev_optarg != optarg) {
+ /* reset the state */
+ optchr = 0;
+ dash = 0;
+ }
+ prev_optarg = optarg;
+
if (*optind >= argc) {
return(EOF);
}