diff options
author | pst <pst@FreeBSD.org> | 1996-12-15 20:39:30 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1996-12-15 20:39:30 +0000 |
commit | 7f6c21847423b44b057a2cfb319dd1d35ca935bf (patch) | |
tree | 4b4edf139101e6a0b72053dca0b43ccaf8063ebe /usr.sbin/ppp | |
parent | 3f499be2dd9c6fab8e40217504ce60d413aeba68 (diff) | |
download | FreeBSD-src-7f6c21847423b44b057a2cfb319dd1d35ca935bf.zip FreeBSD-src-7f6c21847423b44b057a2cfb319dd1d35ca935bf.tar.gz |
Avoid some buffer overrun problems.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/chat.c | 4 | ||||
-rw-r--r-- | usr.sbin/ppp/systems.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c index 7c96e31..e831931 100644 --- a/usr.sbin/ppp/chat.c +++ b/usr.sbin/ppp/chat.c @@ -18,7 +18,7 @@ * Columbus, OH 43221 * (614)451-1883 * - * $Id: chat.c,v 1.10 1996/05/11 20:48:20 phk Exp $ + * $Id: chat.c,v 1.11 1996/06/09 20:40:56 ache Exp $ * * TODO: * o Support more UUCP compatible control sequences. @@ -377,7 +377,7 @@ char *command, *out; } cp--; } - sprintf(tmp, "%s %s", command, cp); + snprintf(tmp, sizeof tmp, "%s %s", command, cp); (void) MakeArgs(tmp, &vector); pipe(fids); diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c index eec0c5f..083d7f6 100644 --- a/usr.sbin/ppp/systems.c +++ b/usr.sbin/ppp/systems.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: systems.c,v 1.5 1995/05/30 03:50:58 rgrimes Exp $ + * $Id: systems.c,v 1.6 1996/03/08 09:03:09 ache Exp $ * * TODO: */ @@ -75,12 +75,12 @@ char *file; cp = getenv("HOME"); if (cp) { SetUserId(); - sprintf(line, "%s/.%s", cp, file); + snprintf(line, sizeof line, "%s/.%s", cp, file); fp = fopen(line, "r"); } if (fp == NULL) { SetPppId(); - sprintf(line, "%s/%s",_PATH_PPP, file); + snprintf(line, sizeof line, "%s/%s", _PATH_PPP, file); fp = fopen(line, "r"); } if (fp == NULL) { @@ -115,12 +115,12 @@ char *file; cp = getenv("HOME"); if (cp) { SetUserId(); - sprintf(line, "%s/.%s", cp, file); + snprintf(line, sizeof line, "%s/.%s", cp, file); fp = fopen(line, "r"); } if (fp == NULL) { SetPppId(); /* fix from pdp@ark.jr3uom.iijnet.or.jp */ - sprintf(line, "%s/%s",_PATH_PPP, file); + snprintf(line, sizeof line, "%s/%s", _PATH_PPP, file); fp = fopen(line, "r"); } if (fp == NULL) { |