File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ PHP NEWS
39
39
. Fixed bug #72931 (PDO_FIREBIRD with Firebird 3.0 not work on returning
40
40
statement). (Dorin Marcoci)
41
41
42
+ - phpdbg:
43
+ . Fixed bug #73794 (Crash (out of memory) when using run and # command
44
+ separator). (Bob)
45
+
42
46
- Standard:
43
47
. Fixed bug #73594 (dns_get_record does not populate $additional out parameter).
44
48
(Bruce Weirdan)
Original file line number Diff line number Diff line change @@ -803,10 +803,13 @@ PHPDBG_COMMAND(run) /* {{{ */
803
803
if (param && param -> type != EMPTY_PARAM && param -> len != 0 ) {
804
804
char * * argv = emalloc (5 * sizeof (char * ));
805
805
char * end = param -> str + param -> len , * p = param -> str ;
806
+ char last_byte ;
806
807
int argc = 0 ;
807
808
int i ;
808
809
809
810
while (* end == '\r' || * end == '\n' ) * (end -- ) = 0 ;
811
+ last_byte = end [1 ];
812
+ end [1 ] = 0 ;
810
813
811
814
while (* p == ' ' ) p ++ ;
812
815
while (* p ) {
@@ -870,6 +873,7 @@ PHPDBG_COMMAND(run) /* {{{ */
870
873
efree (argv [i ]);
871
874
}
872
875
efree (argv );
876
+ end [1 ] = last_byte ;
873
877
return SUCCESS ;
874
878
}
875
879
@@ -880,6 +884,8 @@ PHPDBG_COMMAND(run) /* {{{ */
880
884
do p ++ ; while (* p == ' ' );
881
885
}
882
886
}
887
+ end [1 ] = last_byte ;
888
+
883
889
argv [0 ] = SG (request_info ).argv [0 ];
884
890
for (i = SG (request_info ).argc ; -- i ;) {
885
891
efree (SG (request_info ).argv [i ]);
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #73794 (Crash (out of memory) when using run and # command separator)
3
+ --PHPDBG--
4
+ r echo # quit
5
+ --EXPECTF--
6
+ [Successful compilation of %s]
7
+ prompt> echo
8
+ --FILE--
9
+ <?php
10
+ echo $ argv [1 ];
11
+ ?>
You can’t perform that action at this time.
0 commit comments