com php-src: Fix copying too much leading to potential segfault: sapi/phpdbg/phpdbg_prompt.c

From: Date: Wed, 25 Jan 2017 12:00:48 +0000
Subject: com php-src: Fix copying too much leading to potential segfault: sapi/phpdbg/phpdbg_prompt.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96865@lists.php.net to get a copy of this message
Commit: c44efbbbb1a1b32ee3756b270f41c7507ee22e3b Author: Bob Weinand <bobwei9@hotmail.com> Wed, 25 Jan 2017 13:00:48 +0100 Parents: 80a851b4dd622f5825e46a7318bdd80123205b02 Branches: PHP-7.0 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c44efbbbb1a1b32ee3756b270f41c7507ee22e3b Log: Fix copying too much leading to potential segfault Changed paths: M sapi/phpdbg/phpdbg_prompt.c Diff: diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 7050904..0b4e69c 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;

« previous php.cvs (#96865) next »