]> granicus.if.org Git - php/commitdiff
Fix copying too much leading to potential segfault
authorBob Weinand <bobwei9@hotmail.com>
Wed, 25 Jan 2017 12:00:48 +0000 (13:00 +0100)
committerBob Weinand <bobwei9@hotmail.com>
Wed, 25 Jan 2017 12:00:48 +0000 (13:00 +0100)
sapi/phpdbg/phpdbg_prompt.c

index 7050904c292fa2df9d9495347a76257542f0b0a9..0b4e69ca0e611b325b4fdc5cac35123e63f05d17 100644 (file)
@@ -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;