mirror of
git://git.musl-libc.org/musl
synced 2025-02-01 03:21:33 +00:00
fix regression in getspnam[_r] error code for insufficient buffer size
commit 2d7d05f031
wrongly changed ERANGE
to EINVAL, likely as the result of copy-and-paste error.
This commit is contained in:
parent
5948bc1a64
commit
91d34c4533
@ -76,7 +76,7 @@ int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct
|
||||
|
||||
/* Buffer size must at least be able to hold name, plus some.. */
|
||||
if (size < l+100)
|
||||
return errno = EINVAL;
|
||||
return errno = ERANGE;
|
||||
|
||||
/* Protect against truncation */
|
||||
if (snprintf(path, sizeof path, "/etc/tcb/%s/shadow", name) >= sizeof path)
|
||||
|
Loading…
Reference in New Issue
Block a user