summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_list.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-08-03 20:49:41 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-08-03 20:49:41 +0200
commitb20953118ba41cd9465ccc84e79b6eef3f539573 (patch)
tree477307ebca815d5412fc11ff021bf1d48e0e48d4 /sapi/phpdbg/phpdbg_list.c
parentb5e16cebda52b25f651b97c9b9da830ee7e46138 (diff)
downloadphp-git-b20953118ba41cd9465ccc84e79b6eef3f539573.tar.gz
Fix last invalid read
Also revert debugging run-tests.php changes...
Diffstat (limited to 'sapi/phpdbg/phpdbg_list.c')
-rw-r--r--sapi/phpdbg/phpdbg_list.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index 89e352a971..8369018fc9 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -244,11 +244,11 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
return NULL;
}
- data.buf = emalloc(data.len + 1);
+ data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1);
if (data.len > 0) {
memcpy(data.buf, bufptr, data.len);
}
- data.buf[data.len] = 0;
+ memset(data.buf + data.len, 0, ZEND_MMAP_AHEAD + 1);
data.filename = filename;
data.line[0] = 0;