diff options
author | brian <brian@FreeBSD.org> | 2001-08-20 14:53:05 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-08-20 14:53:05 +0000 |
commit | 6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59 (patch) | |
tree | 43eccc3994dfc9fbe0ce6fb8ae79fc9900a73306 /sbin/ping6 | |
parent | 5bd90784a67de0a5e78e5bd967e2cd3d4f126cb7 (diff) | |
download | FreeBSD-src-6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59.zip FreeBSD-src-6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59.tar.gz |
Handle snprintf() returning < 0 (not just -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 83f6682..790e921 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 == -1 || l >= sizeof(cresult)) + if (l < 0 || l >= sizeof(cresult)) return NULL; if (strlcat(buf, cresult, bufsiz) >= bufsiz) return NULL; /*result overrun*/ |