Skip to content

Commit c44efbb

Browse files
committed
Fix copying too much leading to potential segfault
1 parent 80a851b commit c44efbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sapi/phpdbg/phpdbg_prompt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ int phpdbg_compile(void) /* {{{ */
616616
memmove(data->line + 1, data->line, sizeof(uint) * data->lines);
617617
data->line[0] = 0;
618618
data->buf = erealloc(data->buf, data->len + start_line_len);
619-
memmove(data->buf + start_line_len, data->buf, data->len * sizeof(uint));
619+
memmove(data->buf + start_line_len, data->buf, data->len);
620620
memcpy(data->buf, start_line, start_line_len);
621621
efree(start_line);
622622
data->len += start_line_len;

0 commit comments

Comments
 (0)