mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Fix valgrind warning upon displaying lines from eval()ed code in phpdbg
This commit is contained in:
parent
89aa1b7392
commit
84b608de10
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user