1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-28 10:56:36 +00:00

Fix bug #18516 with SIGSEGV in expand-file-name.

src/fileio.c (Fexpand_file_name) [DOS_NT]: Make sure newdirlim is
 always set to a valid value.  Make sure the size passed to alloca
 is always positive.
This commit is contained in:
Eli Zaretskii 2014-09-22 17:37:22 +03:00
parent 601a0cfe86
commit f11af8a48c
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2014-09-22 Eli Zaretskii <eliz@gnu.org>
* fileio.c (Fexpand_file_name) [DOS_NT]: Make sure newdirlim is
always set to a valid value. Make sure the size passed to alloca
is always positive. (Bug#18516)
2014-09-22 Dmitry Antipov <dmantipov@yandex.ru>
Avoid extra call to oblookup when interning symbols.

View File

@ -1237,6 +1237,8 @@ filesystem tree, not (expand-file-name ".." dirname). */)
newdirlim = adir + SBYTES (tem);
memcpy (adir, SSDATA (tem), SBYTES (tem) + 1);
}
else
newdirlim = adir + strlen (adir);
}
if (!adir)
{
@ -1383,6 +1385,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
/* Now concatenate the directory and name to new space in the stack frame. */
tlen = length + file_name_as_directory_slop + (nmlim - nm) + 1;
eassert (tlen > file_name_as_directory_slop + 1);
#ifdef DOS_NT
/* Reserve space for drive specifier and escape prefix, since either
or both may need to be inserted. (The Microsoft x86 compiler