diff options
Diffstat (limited to 'ext/standard/exec.c')
-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 38844393e7..e0ca9140f7 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -372,7 +372,7 @@ PHPAPI char *php_escape_shell_cmd(char *str) } cmd[y] = '\0'; - if (y - 1 > cmd_max_len) { + if (y > cmd_max_len + 1) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Escaped command exceeds the allowed length of %d bytes", cmd_max_len); efree(cmd); return NULL; @@ -459,7 +459,7 @@ PHPAPI char *php_escape_shell_arg(char *str) #endif cmd[y] = '\0'; - if (y - 1 > cmd_max_len) { + if (y > cmd_max_len + 1) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Escaped argument exceeds the allowed length of %d bytes", cmd_max_len); efree(cmd); return NULL; |