about summary refs log tree commit diff
path: root/src/passwd
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2017-06-21 19:06:45 -0400
committerRich Felker <dalias@aerifal.cx>2017-06-21 19:06:45 -0400
commit91d34c4533e6bf6eacad7a9f001f28f9e5ebc656 (patch)
tree2a62a1ab010f6b877564bb26095c0df1a68eb81b /src/passwd
parent5948bc1a642e6cead729602c9e1a251d5f60bddb (diff)
downloadmusl-91d34c4533e6bf6eacad7a9f001f28f9e5ebc656.tar.gz
musl-91d34c4533e6bf6eacad7a9f001f28f9e5ebc656.tar.xz
musl-91d34c4533e6bf6eacad7a9f001f28f9e5ebc656.zip
fix regression in getspnam[_r] error code for insufficient buffer size
commit 2d7d05f031e014068a61d3076c6178513395d2ae wrongly changed ERANGE
to EINVAL, likely as the result of copy-and-paste error.
Diffstat (limited to 'src/passwd')
-rw-r--r--src/passwd/getspnam_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passwd/getspnam_r.c b/src/passwd/getspnam_r.c
index e488b67f..541206fa 100644
--- a/src/passwd/getspnam_r.c
+++ b/src/passwd/getspnam_r.c
@@ -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)