diff options
author | brian <brian@FreeBSD.org> | 2001-08-20 12:56:45 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-08-20 12:56:45 +0000 |
commit | 016b1a255a4619a8b85d12e8ef931c0dfa1e13ae (patch) | |
tree | b8663d7f77ab3499896e68cc38771d771c5b2f6f /sbin/ping6 | |
parent | 110fc843a0e59e68be1a9d8d1a4bb0bcb152872b (diff) | |
download | FreeBSD-src-016b1a255a4619a8b85d12e8ef931c0dfa1e13ae.zip FreeBSD-src-016b1a255a4619a8b85d12e8ef931c0dfa1e13ae.tar.gz |
Handle snprintf() returning -1.
MFC after: 2 weeks
Diffstat (limited to 'sbin/ping6')
-rw-r--r-- | sbin/ping6/ping6.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 1259b4a..83f6682 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1353,7 +1353,7 @@ dnsdecode(sp, ep, base, buf, bufsiz) while (i-- > 0 && cp < ep) { l = snprintf(cresult, sizeof(cresult), isprint(*cp) ? "%c" : "\\%03o", *cp & 0xff); - if (l >= sizeof(cresult)) + if (l == -1 || l >= sizeof(cresult)) return NULL; if (strlcat(buf, cresult, bufsiz) >= bufsiz) return NULL; /*result overrun*/ |