diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-04 20:25:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-04 20:25:08 +0000 |
commit | 96eef4873443f17a48dc476e38e0ce7c3dfb7af1 (patch) | |
tree | a0074d08345d60f73dbe2cb4389526f43ddf57ee /usr.sbin/pppd/ipcp.c | |
parent | 87bb416d9162030904882f8dc0b054ecc84f194c (diff) |
strlcpy and snprintf; various people ok
Diffstat (limited to 'usr.sbin/pppd/ipcp.c')
-rw-r--r-- | usr.sbin/pppd/ipcp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/pppd/ipcp.c b/usr.sbin/pppd/ipcp.c index 93282afddfc..578cb771827 100644 --- a/usr.sbin/pppd/ipcp.c +++ b/usr.sbin/pppd/ipcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipcp.c,v 1.9 2002/07/01 19:31:37 deraadt Exp $ */ +/* $OpenBSD: ipcp.c,v 1.10 2003/04/04 20:25:07 deraadt Exp $ */ /* * ipcp.c - PPP IP Control Protocol. @@ -46,7 +46,7 @@ #if 0 static char rcsid[] = "Id: ipcp.c,v 1.34 1998/04/28 23:38:09 paulus Exp $"; #else -static char rcsid[] = "$OpenBSD: ipcp.c,v 1.9 2002/07/01 19:31:37 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ipcp.c,v 1.10 2003/04/04 20:25:07 deraadt Exp $"; #endif #endif @@ -174,7 +174,7 @@ u_int32_t ipaddr; ipaddr = ntohl(ipaddr); - sprintf(b, "%d.%d.%d.%d", + snprintf(b, sizeof b, "%d.%d.%d.%d", (u_char)(ipaddr >> 24), (u_char)(ipaddr >> 16), (u_char)(ipaddr >> 8), @@ -1368,9 +1368,11 @@ ipcp_script(f, script) char strspeed[32], strlocal[32], strremote[32]; char *argv[8]; - sprintf(strspeed, "%d", baud_rate); - strcpy(strlocal, ip_ntoa(ipcp_gotoptions[f->unit].ouraddr)); - strcpy(strremote, ip_ntoa(ipcp_hisoptions[f->unit].hisaddr)); + snprintf(strspeed, sizeof strspeed, "%d", baud_rate); + strlcpy(strlocal, ip_ntoa(ipcp_gotoptions[f->unit].ouraddr), + sizeof strlocal); + strlcpy(strremote, ip_ntoa(ipcp_hisoptions[f->unit].hisaddr), + sizeof strremote); argv[0] = script; argv[1] = ifname; |