Mercurial > hg > xemacs-beta
diff src/dumper.c @ 4137:1ce0622a56a3
[xemacs-hg @ 2007-08-22 15:10:10 by aidan]
Patch from Nix; fix buffer overrun in pdump_load()
See
87y7r4lzwf.fsf@hades.wkstn.nix , also
http://calypso.tux.org/pipermail/xemacs-patches/2006-October/000017.html
for explanation
author | aidan |
---|---|
date | Wed, 22 Aug 2007 15:10:19 +0000 |
parents | a4917b3c97cc |
children | 1a14c304cb8e |
line wrap: on
line diff
--- a/src/dumper.c Wed Aug 22 07:15:29 2007 +0000 +++ b/src/dumper.c Wed Aug 22 15:10:19 2007 +0000 @@ -2659,7 +2659,7 @@ wext_strcpy (exe_path, wexe); } #else /* !WIN32_NATIVE */ - Wexttext *exe_path; + Wexttext exe_path[PATH_MAX_EXTERNAL]; Wexttext *w; const Wexttext *dir, *p; @@ -2693,8 +2693,7 @@ if (p != dir) { /* invocation-name includes a directory component -- presumably it - is relative to cwd, not $PATH */ - exe_path = alloca_array (Wexttext, 1 + wext_strlen (dir)); + is relative to cwd, not $PATH. */ wext_strcpy (exe_path, dir); } else @@ -2702,9 +2701,6 @@ const Wexttext *path = wext_getenv ("PATH"); /* not egetenv -- not yet init. */ const Wexttext *name = p; - exe_path = alloca_array (Wexttext, - 10 + max (wext_strlen (name), - wext_strlen (path))); for (;;) { p = path;