com php-src: Fix valgrind warning upon displaying lines from eval()ed code in phpdbg: sapi/phpdbg/phpdbg_list.c
| From: | Bob Weinand | Date: | Mon, 31 Aug 2015 21:42:15 +0000 |
| Subject: | com php-src: Fix valgrind warning upon displaying lines from eval()ed code in phpdbg: sapi/phpdbg/phpdbg_list.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88810@lists.php.net to get a copy of this message | ||
Commit: 84b608de1042696e394330e9fa205850c7a133f9
Author: Bob Weinand <bobwei9@hotmail.com> Mon, 31 Aug 2015 23:42:15 +0200
Parents: 89aa1b73929d3a02d4e0bae6edf76e6b325ce8f9
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=84b608de1042696e394330e9fa205850c7a133f9
Log:
Fix valgrind warning upon displaying lines from eval()ed code in phpdbg
Changed paths:
M sapi/phpdbg/phpdbg_list.c
Diff:
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index a6f1f9a..dfacc0f 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;