summaryrefslogtreecommitdiffstats
path: root/sbin/route
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-08-20 14:53:05 +0000
committerbrian <brian@FreeBSD.org>2001-08-20 14:53:05 +0000
commit6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59 (patch)
tree43eccc3994dfc9fbe0ce6fb8ae79fc9900a73306 /sbin/route
parent5bd90784a67de0a5e78e5bd967e2cd3d4f126cb7 (diff)
downloadFreeBSD-src-6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59.zip
FreeBSD-src-6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59.tar.gz
Handle snprintf() returning < 0 (not just -1)
MFC after: 2 weeks
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 64a2e60..dd23bc1 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -410,6 +410,8 @@ routename(sa)
while (++s < slim && cp < cpe) /* start with sa->sa_data */
if ((n = snprintf(cp, cpe - cp, " %x", *s)) > 0)
cp += n;
+ else
+ *cp = '\0';
break;
}
}
@@ -546,6 +548,8 @@ netname(sa)
while (s < slim && cp < cpe)
if ((n = snprintf(cp, cpe - cp, " %x", *s++)) > 0)
cp += n;
+ else
+ *cp = '\0';
break;
}
}
OpenPOWER on IntegriCloud