Skip to content

Commit 84b608d

Browse files
committed
Fix valgrind warning upon displaying lines from eval()ed code in phpdbg
1 parent 89aa1b7 commit 84b608d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sapi/phpdbg/phpdbg_list.c

+1
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ zend_op_array *phpdbg_compile_string(zval *source_string, char *filename) {
333333
dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * Z_STRLEN_P(source_string));
334334
dataptr->buf = estrndup(Z_STRVAL_P(source_string), Z_STRLEN_P(source_string));
335335
dataptr->len = Z_STRLEN_P(source_string);
336+
dataptr->line[0] = 0;
336337
for (line = 0, bufptr = dataptr->buf - 1, endptr = dataptr->buf + dataptr->len; ++bufptr < endptr;) {
337338
if (*bufptr == '\n') {
338339
dataptr->line[++line] = (uint)(bufptr - dataptr->buf) + 1;

0 commit comments

Comments
 (0)