diff options
author | brian <brian@FreeBSD.org> | 2001-08-20 12:41:36 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-08-20 12:41:36 +0000 |
commit | d3f8bf41540e86650a4907ac13969e50daf457de (patch) | |
tree | a338dbd809527b6eef0d9f694fb16f1d731ed3d3 | |
parent | 540c23ed8a4a0f8b0ca105c3753defbe1b014e43 (diff) | |
download | FreeBSD-src-d3f8bf41540e86650a4907ac13969e50daf457de.zip FreeBSD-src-d3f8bf41540e86650a4907ac13969e50daf457de.tar.gz |
Handle snprintf() returning -1
MFC after: 2 weeks
-rw-r--r-- | lib/libc/posix1e/acl_support.c | 4 |
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); } |