Browse Source

Fix copying too much leading to potential segfault

pull/2337/head
Bob Weinand 10 years ago
parent
commit
c44efbbbb1
  1. 2
      sapi/phpdbg/phpdbg_prompt.c

2
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;

Loading…
Cancel
Save