mirror of
https://github.com/php/php-src.git
synced 2024-12-11 10:54:47 +08:00
Merge branch 'PHP-7.1'
This commit is contained in:
commit
c3ee875aec
@ -800,10 +800,13 @@ PHPDBG_COMMAND(run) /* {{{ */
|
||||
if (param && param->type != EMPTY_PARAM && param->len != 0) {
|
||||
char **argv = emalloc(5 * sizeof(char *));
|
||||
char *end = param->str + param->len, *p = param->str;
|
||||
char last_byte;
|
||||
int argc = 0;
|
||||
int i;
|
||||
|
||||
while (*end == '\r' || *end == '\n') *(end--) = 0;
|
||||
last_byte = end[1];
|
||||
end[1] = 0;
|
||||
|
||||
while (*p == ' ') p++;
|
||||
while (*p) {
|
||||
@ -867,6 +870,7 @@ free_cmd:
|
||||
efree(argv[i]);
|
||||
}
|
||||
efree(argv);
|
||||
end[1] = last_byte;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@ -877,6 +881,8 @@ free_cmd:
|
||||
do p++; while (*p == ' ');
|
||||
}
|
||||
}
|
||||
end[1] = last_byte;
|
||||
|
||||
argv[0] = SG(request_info).argv[0];
|
||||
for (i = SG(request_info).argc; --i;) {
|
||||
efree(SG(request_info).argv[i]);
|
||||
|
11
sapi/phpdbg/tests/bug73794.phpt
Normal file
11
sapi/phpdbg/tests/bug73794.phpt
Normal file
@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #73794 (Crash (out of memory) when using run and # command separator)
|
||||
--PHPDBG--
|
||||
r echo # quit
|
||||
--EXPECTF--
|
||||
[Successful compilation of %s]
|
||||
prompt> echo
|
||||
--FILE--
|
||||
<?php
|
||||
echo $argv[1];
|
||||
?>
|
Loading…
Reference in New Issue
Block a user