diff options
author | imp <imp@FreeBSD.org> | 1997-01-10 07:53:28 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1997-01-10 07:53:28 +0000 |
commit | bf83493bdc4599da7c7f60af23bd74c0e657a98f (patch) | |
tree | 3c5f5f3ad5ea638680e4a543a64066fb208ae92f /usr.sbin/ppp/main.c | |
parent | 97aa7b5184f1f12bd25cdc14bc7074351a3fe9aa (diff) | |
download | FreeBSD-src-bf83493bdc4599da7c7f60af23bd74c0e657a98f.zip FreeBSD-src-bf83493bdc4599da7c7f60af23bd74c0e657a98f.tar.gz |
Fix many buffer overruns in the code. Specifically, disallow ExpandString
to be used to expand things beyond the size of the buffer passed in. Also
do a general cleanup of sprintf -> snprintf as well as strcpy and strncat
safety. Also expand some buffers to allow for the largest possible data
that might be used.
This is a 2.2 candidate. However, it needs to be vetted on -current
since little testing has been done on this due to my lack of PPP on
this machine.
Reviewed by: Jordan Hubbard, Peter Wemm, Guido van Rooij
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r-- | usr.sbin/ppp/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index 75d78a5..cc0f7a1 100644 --- a/usr.sbin/ppp/main.c +++ b/usr.sbin/ppp/main.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: main.c,v 1.25 1996/12/19 00:41:42 nate Exp $ + * $Id: main.c,v 1.26 1996/12/22 17:29:31 jkh Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -448,7 +448,7 @@ char **argv; snprintf(pid_filename, sizeof (pid_filename), "%s/ppp.tun%d.pid", _PATH_VARRUN, tunno); unlink(pid_filename); - sprintf(pid, "%d\n", (int)getpid()); + snprintf(pid, sizeof(pid), "%d\n", (int)getpid()); if ((fd = open(pid_filename, O_RDWR|O_CREAT, 0666)) != -1) { |