1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 00:48:25 +02:00

Fixed segfault when listing and last line is empty

Conflicts:
	phpdbg_list.c
This commit is contained in:
Bob Weinand
2014-10-09 12:43:53 +02:00
parent ca7f2f5f43
commit 0bcb32ae47
+6 -1
View File
@@ -158,6 +158,10 @@ void phpdbg_list_file(const char *filename, uint count, uint offset, uint highli
phpdbg_write(">%05u: %.*s", line, linelen, buffer);
}
}
if (*(buffer + linelen - 1) != '\n' || !linelen) {
phpdbg_writeln(EMPTY);
}
}
} /* }}} */
@@ -256,8 +260,9 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) {
dataptr->line[++line] = (uint)(bufptr - data.buf) + 1;
}
}
dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line);
dataptr->lines = ++line;
dataptr->line[line] = endptr - data.buf;
dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line);
ret = PHPDBG_G(compile_file)(&fake, type TSRMLS_CC);