summaryrefslogtreecommitdiffstats
path: root/sbin/ping6/ping6.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-08-20 12:56:45 +0000
committerbrian <brian@FreeBSD.org>2001-08-20 12:56:45 +0000
commit016b1a255a4619a8b85d12e8ef931c0dfa1e13ae (patch)
treeb8663d7f77ab3499896e68cc38771d771c5b2f6f /sbin/ping6/ping6.c
parent110fc843a0e59e68be1a9d8d1a4bb0bcb152872b (diff)
downloadFreeBSD-src-016b1a255a4619a8b85d12e8ef931c0dfa1e13ae.zip
FreeBSD-src-016b1a255a4619a8b85d12e8ef931c0dfa1e13ae.tar.gz
Handle snprintf() returning -1.
MFC after: 2 weeks
Diffstat (limited to 'sbin/ping6/ping6.c')
-rw-r--r--sbin/ping6/ping6.c2
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*/
OpenPOWER on IntegriCloud