2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
+ * callproc.c (child_setup): Don't assume strlen fits in int.
+
* buffer.c: Memory overflow fixes.
(overlays_at, overlays_in, record_overlay_string, overlay_strings):
Don't update size of array until after memory allocation succeeds,
cleaned up in the usual way. */
{
register char *temp;
- register int i;
+ register ptrdiff_t i;
i = SBYTES (current_dir);
+ if (min (PTRDIFF_MAX, SIZE_MAX) - 6 < i)
+ memory_full (SIZE_MAX);
#ifdef MSDOS
/* MSDOS must have all environment variables malloc'ed, because
low-level libc functions that launch subsidiary processes rely