Revert "Fixed invalid read"

I must be confused while switching from master to 5.6

This reverts commit 94957a7091.
This commit is contained in:
Xinchen Hui 2015-07-08 22:34:27 +08:00
parent 94957a7091
commit c75d245e82

View File

@ -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';