1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00
Files
archived-php-src/sapi/phpdbg/tests/watch_007.phpt
Niels Dossche 398a10a58a Fix phpdbg segmentation fault in case of malformed input
If you were to enter "w $>" the function would crash with a segmentation
fault because last_index is still NULL at that point. Fix it by checking
for NULL and erroring out if it is.

Closes GH-10353

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-17 14:12:49 +00:00

26 lines
372 B
PHP

--TEST--
Test malformed watchpoint name
--INI--
opcache.optimization_level=0
--PHPDBG--
b test
r
w $>
q
--EXPECTF--
[Successful compilation of %s]
prompt> [Breakpoint #0 added at test]
prompt> [Breakpoint #0 in test() at %s:%d, hits: 1]
>00004: }
00005: test();
00006: $a = 2;
prompt> [Malformed input]
prompt>
--FILE--
<?php
$a = 1;
function test() {
}
test();
$a = 2;