mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
Subject: hurd: Make __realpath return EINVAL on NULL buf
As Posix and stdlib/test-canon.c expects it, and rather than letting pathconf crash.
This commit is contained in:
parent
5e4435f960
commit
2345bc44bb
1 changed files with 10 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
@ -30,7 +31,15 @@ __realpath_chk (const char *buf, char *resolved, size_t resolvedlen)
|
||||||
|
|
||||||
return __realpath (buf, resolved);
|
return __realpath (buf, resolved);
|
||||||
#else
|
#else
|
||||||
long int pathmax =__pathconf (buf, _PC_PATH_MAX);
|
long int pathmax;
|
||||||
|
|
||||||
|
if (buf == NULL)
|
||||||
|
{
|
||||||
|
__set_errno (EINVAL);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
pathmax = __pathconf (buf, _PC_PATH_MAX);
|
||||||
if (pathmax != -1)
|
if (pathmax != -1)
|
||||||
{
|
{
|
||||||
/* We do have a fixed limit. */
|
/* We do have a fixed limit. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue