Commit a37c69bf authored by Paul Eggert's avatar Paul Eggert
Browse files

* minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.

Check for integer overflow on size calculations.
parent 328ab8e7
2011-04-02 Paul Eggert <eggert@cs.ucla.edu>
* minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
Check for integer overflow on size calculations.
* buffer.c (Fprevious_overlay_change): Remove var that is set
but not used.
......@@ -229,7 +229,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
Lisp_Object defalt,
int allow_props, int inherit_input_method)
{
int size, len;
size_t size, len;
char *line, *s;
Lisp_Object val;
......@@ -244,6 +244,8 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
&& (len = strlen (line),
len == size - 1 && line[len - 1] != '\n'))
{
if ((size_t) -1 / 2 < size)
memory_full ();
size *= 2;
line = (char *) xrealloc (line, size);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment