If either the path or the resolved path is NULL, realpath() now returns
EINVAL. This also fixes bug #1659. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23087 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9abdc42489
commit
5f23ba4ac9
@ -58,6 +58,11 @@ realpath(const char *path, char *resolved)
|
||||
char *p, *q, wbuf[MAXPATHLEN];
|
||||
int symlinks = 0;
|
||||
|
||||
if (path == NULL || resolved == NULL) {
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Save the starting point. */
|
||||
if ((fd = open(".", O_RDONLY)) < 0) {
|
||||
strcpy(resolved, ".");
|
||||
|
Loading…
Reference in New Issue
Block a user