summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/mp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-08-18 22:43:11 +0000
committerbrian <brian@FreeBSD.org>2001-08-18 22:43:11 +0000
commitd100840eb7b3d72a075f3d3054a695e8ea3b03eb (patch)
tree2bac82065af28df764244c67c53be0dc576bc440 /usr.sbin/ppp/mp.c
parent1f224ee69c85230adf44e21d13c1a5d0b034cfc2 (diff)
downloadFreeBSD-src-d100840eb7b3d72a075f3d3054a695e8ea3b03eb.zip
FreeBSD-src-d100840eb7b3d72a075f3d3054a695e8ea3b03eb.tar.gz
Better handling for the return of snprintf().
Diffstat (limited to 'usr.sbin/ppp/mp.c')
-rw-r--r--usr.sbin/ppp/mp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c
index ac9321b..f288c8d 100644
--- a/usr.sbin/ppp/mp.c
+++ b/usr.sbin/ppp/mp.c
@@ -1124,6 +1124,10 @@ mpserver_Open(struct mpserver *s, struct peerid *peer)
l = snprintf(s->socket.sun_path, sizeof s->socket.sun_path, "%sppp-%s-%02x-",
_PATH_VARRUN, peer->authname, peer->enddisc.class);
+ if (l < 0) {
+ log_Printf(LogERROR, "mpserver: snprintf(): %s\n", strerror(errno));
+ return MPSERVER_FAILED;
+ }
for (f = 0; f < peer->enddisc.len && l < sizeof s->socket.sun_path - 2; f++) {
snprintf(s->socket.sun_path + l, sizeof s->socket.sun_path - l,
OpenPOWER on IntegriCloud