Commit 860887db authored by Paul Eggert's avatar Paul Eggert
Browse files

* callproc.c (child_setup): Don't assume strlen fits in int.

parent 6e1fc452
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,
......
......@@ -1145,9 +1145,11 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
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
......
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