Fix allocation limit for getcwd syscall
Andreas Schwab
schwab@suse.de
Fri Nov 4 11:42:00 GMT 2005
The actual filename limit of the getcwd syscall is PAGE_SIZE. If we don't
allocate a buffer big enough we get an assertion failure when $PWD is
longer than PATH_MAX.
Andreas.
2005-11-04 Andreas Schwab <schwab@suse.de>
* sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Increase default
allocation size to one page.
--- sysdeps/unix/sysv/linux/getcwd.c.~1.22.~ 2003-09-22 22:58:00.000000000 +0200
+++ sysdeps/unix/sysv/linux/getcwd.c 2005-10-01 23:41:53.000000000 +0200
@@ -86,7 +86,7 @@ __getcwd (char *buf, size_t size)
return NULL;
}
- alloc_size = PATH_MAX;
+ alloc_size = __getpagesize ();
}
if (buf == NULL)
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
More information about the Libc-hacker
mailing list