Check for integer overflow on size calculations.
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.
Lisp_Object defalt,
int allow_props, int inherit_input_method)
{
- int size, len;
+ size_t size, len;
char *line, *s;
Lisp_Object val;
&& (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);
}