* kern/emu/misc.c (canonicalize_file_name): realpath can still
return NULL for various reasons even if it has a maximum-length buffer: for example, there might be a symlink loop, or the path might exceed PATH_MAX. If this happens, return NULL.
This commit is contained in:
parent
5fdba519bb
commit
db2102a046
2 changed files with 9 additions and 1 deletions
|
@ -185,7 +185,8 @@ canonicalize_file_name (const char *path)
|
|||
char *ret;
|
||||
#ifdef PATH_MAX
|
||||
ret = xmalloc (PATH_MAX);
|
||||
(void) realpath (path, ret);
|
||||
if (!realpath (path, ret))
|
||||
return NULL;
|
||||
#else
|
||||
ret = realpath (path, NULL);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue