summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-08-20 12:41:36 +0000
committerbrian <brian@FreeBSD.org>2001-08-20 12:41:36 +0000
commitd3f8bf41540e86650a4907ac13969e50daf457de (patch)
treea338dbd809527b6eef0d9f694fb16f1d731ed3d3 /lib/libc/posix1e
parent540c23ed8a4a0f8b0ca105c3753defbe1b014e43 (diff)
downloadFreeBSD-src-d3f8bf41540e86650a4907ac13969e50daf457de.zip
FreeBSD-src-d3f8bf41540e86650a4907ac13969e50daf457de.tar.gz
Handle snprintf() returning -1
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/posix1e')
-rw-r--r--lib/libc/posix1e/acl_support.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/posix1e/acl_support.c b/lib/libc/posix1e/acl_support.c
index 0ab061d..791b26b 100644
--- a/lib/libc/posix1e/acl_support.c
+++ b/lib/libc/posix1e/acl_support.c
@@ -260,7 +260,7 @@ _posix1e_acl_id_to_name(acl_tag_t tag, uid_t id, ssize_t buf_len, char *buf)
else
i = snprintf(buf, buf_len, "%s", p->pw_name);
- if (i >= buf_len) {
+ if (i < 0 || i >= buf_len) {
errno = ENOMEM;
return (-1);
}
@@ -273,7 +273,7 @@ _posix1e_acl_id_to_name(acl_tag_t tag, uid_t id, ssize_t buf_len, char *buf)
else
i = snprintf(buf, buf_len, "%s", g->gr_name);
- if (i >= buf_len) {
+ if (i < 0 || i >= buf_len) {
errno = ENOMEM;
return (-1);
}
OpenPOWER on IntegriCloud