[php-src] Issue #9710: phpdbg memory leaks by option "-h"

From: Date: Mon, 10 Oct 2022 18:03:59 +0000
Subject: [php-src] Issue #9710: phpdbg memory leaks by option "-h"
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-242571@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/9710 Author: randomssr ### Description phpdbg memory leaks by misuse of the option "-h" When the program input contains the option of "-h", the program will cause memory leaks and cause crash. ### Test Environment Ubuntu 20.04, 64 bit PHP (version: 8.0.23) ### How to trigger 1. Compile the program with AddressSanitizer $ CC=/home/root/AFLplusplus/afl-clang-fast CXX=/home/root/AFLplusplus/afl-clang-fast++ CFLAGS="-g -O0 -fsanitize=address" CXXFLAGS="-g -O0 -fsanitize=address" ./configure --prefix=pwd/install 2. Run command $ ./phpdbg -h ### Details #### ASAN report $ ./phpdbg -h phpdbg is a lightweight, powerful and easy to use debugging platform for PHP5.4+ It supports the following commands: Information list list PHP source info displays information on the debug session print show opcodes frame select a stack frame and print a stack frame summary generator show active generators or select a generator frame back shows the current backtrace help provide help on a topic Starting and Stopping Execution exec set execution context stdin set executing script from stdin run attempt execution step continue execution until other line is reached continue continue execution until continue execution up to the given location next continue execution up to the given location and halt on the first line after it finish continue up to end of the current execution frame leave continue up to end of the current execution frame and halt after the calling instruction break set a breakpoint at the specified target watch set a watchpoint on $variable clear clear one or all breakpoints clean clean the execution environment Miscellaneous set set the phpdbg configuration source execute a phpdbginit script register register a phpdbginit function as a command alias sh shell a command ev evaluate some code quit exit phpdbg Type help <command> or (help alias) to get detailed help on any of the above ---Type <return> to continue or q <return> to quit--- commands, for example help list or h l. Note that help will also match partial commands if unique (and list out options if not unique), so help exp will give help on the export command, but help ex will list the summary for exec and export. Type help aliases to show a full alias list, including any registered phpdginit functions Type help syntax for a general introduction to the command syntax. Type help options for a list of phpdbg command line options. Type help phpdbginit to show how to customise the debugger environment. requested help page could not be found ================================================================= ==865119==ERROR: LeakSanitizer: detected memory leaks SUMMARY: AddressSanitizer: 6528 byte(s) leaked in 204 allocation(s). The complete asan report can be seen from url ### PHP Version PHP 8.0.23 ### Operating System _No response_

« previous php.bugs (#242571) next »