diff options
author | Xinchen Hui <laruence@php.net> | 2015-07-08 22:34:27 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2015-07-08 22:34:27 +0800 |
commit | c75d245e82ecea5e1c57ad63d5f81de7a2c3045f (patch) | |
tree | 3440e1edfdefa118c6d823d533811a7e03cfcfc4 | |
parent | 94957a7091d2d87d3b75c8395a3a11a4fbecaea1 (diff) | |
download | php-git-c75d245e82ecea5e1c57ad63d5f81de7a2c3045f.tar.gz |
Revert "Fixed invalid read"
I must be confused while switching from master to 5.6
This reverts commit 94957a7091d2d87d3b75c8395a3a11a4fbecaea1.
-rw-r--r-- | ext/standard/exec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 4764f4bf33..66d4537dab 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -115,7 +115,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ } else if (type == 2) { /* strip trailing whitespaces */ l = bufl; - while (--l >= 0 && isspace(((unsigned char *)buf)[l])); + while (l-- && isspace(((unsigned char *)buf)[l])); if (l != (int)(bufl - 1)) { bufl = l + 1; buf[bufl] = '\0'; @@ -128,7 +128,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ /* strip trailing whitespaces if we have not done so already */ if ((type == 2 && buf != b) || type != 2) { l = bufl; - while (--l >= 0 && isspace(((unsigned char *)buf)[l])); + while (l-- && isspace(((unsigned char *)buf)[l])); if (l != (int)(bufl - 1)) { bufl = l + 1; buf[bufl] = '\0'; |