summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2017-01-25 13:00:48 +0100
committerBob Weinand <bobwei9@hotmail.com>2017-01-25 13:00:48 +0100
commitc44efbbbb1a1b32ee3756b270f41c7507ee22e3b (patch)
treec0b0b11ca52e79cf5e8970687ef11484a47a7f35
parent80a851b4dd622f5825e46a7318bdd80123205b02 (diff)
downloadphp-git-c44efbbbb1a1b32ee3756b270f41c7507ee22e3b.tar.gz
Fix copying too much leading to potential segfault
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 7050904c29..0b4e69ca0e 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -616,7 +616,7 @@ int phpdbg_compile(void) /* {{{ */
memmove(data->line + 1, data->line, sizeof(uint) * data->lines);
data->line[0] = 0;
data->buf = erealloc(data->buf, data->len + start_line_len);
- memmove(data->buf + start_line_len, data->buf, data->len * sizeof(uint));
+ memmove(data->buf + start_line_len, data->buf, data->len);
memcpy(data->buf, start_line, start_line_len);
efree(start_line);
data->len += start_line_len;