* syscalls.cc (pathconf): Guard _PC_PATH_MAX branch against invalid

file parameter.
This commit is contained in:
Corinna Vinschen 2002-01-10 13:24:28 +00:00
parent c0a8e8d0f9
commit bb5225c236
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-01-10 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (pathconf): Guard _PC_PATH_MAX branch against invalid
file parameter.
2002-01-09 Christopher Faylor <cgf@redhat.com>
Robert Collins <rbtcollins@hotmail.com>

View File

@ -1424,6 +1424,8 @@ pathconf (const char *file, int v)
switch (v)
{
case _PC_PATH_MAX:
if (check_null_empty_str_errno (file))
return -1;
return PATH_MAX - strlen (file);
case _PC_NAME_MAX:
return PATH_MAX;