summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-08-31 23:42:15 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-08-31 23:42:15 +0200
commit84b608de1042696e394330e9fa205850c7a133f9 (patch)
tree2efd091b07e48e84bea8aedc2021d5bdd0a4cbcc
parent89aa1b73929d3a02d4e0bae6edf76e6b325ce8f9 (diff)
downloadphp-git-84b608de1042696e394330e9fa205850c7a133f9.tar.gz
Fix valgrind warning upon displaying lines from eval()ed code in phpdbg
-rw-r--r--sapi/phpdbg/phpdbg_list.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index a6f1f9ae28..dfacc0f533 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -333,6 +333,7 @@ zend_op_array *phpdbg_compile_string(zval *source_string, char *filename) {
dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * Z_STRLEN_P(source_string));
dataptr->buf = estrndup(Z_STRVAL_P(source_string), Z_STRLEN_P(source_string));
dataptr->len = Z_STRLEN_P(source_string);
+ dataptr->line[0] = 0;
for (line = 0, bufptr = dataptr->buf - 1, endptr = dataptr->buf + dataptr->len; ++bufptr < endptr;) {
if (*bufptr == '\n') {
dataptr->line[++line] = (uint)(bufptr - dataptr->buf) + 1;