From ab7dd85bfbe9a176c2d5055d52185ae6364f97af Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 13 May 2002 01:48:25 +0000 Subject: 2002-05-13 Marcus Brinkmann * hurd/hurdchdir.c (_hurd_change_directory_port_from_name): Allocate three, not two, more than LEN when appending '/.'. * sysdeps/mach/hurd/chroot.c (chroot): Likewise. Don't check if NAME ends with '/.' if it is shorter than 2 chars. * mach/Makefile ($(mach-syscalls:%=$(objpfx)%.S)): Make the generated files #include instead of . --- sysdeps/mach/hurd/chroot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/mach') diff --git a/sysdeps/mach/hurd/chroot.c b/sysdeps/mach/hurd/chroot.c index 83f11bd17e..fde0164713 100644 --- a/sysdeps/mach/hurd/chroot.c +++ b/sysdeps/mach/hurd/chroot.c @@ -36,11 +36,11 @@ chroot (const char *path) /* Append trailing "/." to directory name to force ENOTDIR if it's not a directory and EACCES if we don't have search permission. */ len = strlen (path); - if (path[len - 2] == '/' && path[len - 1] == '.') + if (len >= 2 && path[len - 2] == '/' && path[len - 1] == '.') lookup = path; else { - char *n = alloca (len + 2); + char *n = alloca (len + 3); memcpy (n, path, len); n[len] = '/'; n[len + 1] = '.'; -- cgit v1.2.3