File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ PHP NEWS
13
13
. Fixed bug GH-17609 (Typo in error message: Dom\NO_DEFAULT_NS instead of
14
14
Dom\HTML_NO_DEFAULT_NS). (nielsdos)
15
15
16
+ - PHPDBG:
17
+ . Partially fixed bug GH-17387 (Trivial crash in phpdbg lexer). (nielsdos)
18
+ . Fix memory leak in phpdbg calling registered function. (nielsdos)
19
+
16
20
30 Jan 2025, PHP 8.4.4
17
21
18
22
- Core:
Original file line number Diff line number Diff line change @@ -160,8 +160,9 @@ INPUT ("\\"[#"']|["]("\\\\"|"\\"["]|[^\n\000"])*["]|[']("\\"[']|"\\\\"|[^\
160
160
161
161
<NORMAL>{GENERIC_ID} {
162
162
phpdbg_init_param(yylval, STR_PARAM);
163
- yylval->str = estrndup(yytext, yyleng - unescape_string(yytext));
164
- yylval->len = yyleng;
163
+ size_t len = yyleng - unescape_string(yytext);
164
+ yylval->str = estrndup(yytext, len);
165
+ yylval->len = len;
165
166
return T_ID;
166
167
}
167
168
Original file line number Diff line number Diff line change @@ -189,6 +189,9 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */
189
189
190
190
zval_ptr_dtor_str (& fci .function_name );
191
191
efree (lc_name );
192
+ if (fci .named_params ) {
193
+ zend_array_destroy (fci .named_params );
194
+ }
192
195
193
196
return SUCCESS ;
194
197
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ registering a function and calling it leaks arguments memory
3
+ --FILE--
4
+ <?php
5
+ echo "Done \n" ;
6
+ ?>
7
+ --PHPDBG--
8
+ register var_dump
9
+ var_dump "a" "b"
10
+ register flush
11
+ flush
12
+ r
13
+ q
14
+ --EXPECTF--
15
+ [Successful compilation of %s]
16
+ prompt> [Registered var_dump]
17
+ prompt> string(1) "a"
18
+ string(1) "b"
19
+
20
+ prompt> [Registered flush]
21
+ prompt>
22
+ prompt> Done
23
+ [Script ended normally]
24
+ prompt>
You can’t perform that action at this time.
0 commit comments