diff options
author | 1999-12-04 21:58:31 +0000 | |
---|---|---|
committer | 1999-12-04 21:58:31 +0000 | |
commit | a5959c1f05b823f268cddedb436dd24ebf69324d (patch) | |
tree | 5dcf1502e958d93665d226d8e000387a7b996a4f | |
parent | rev E name (diff) | |
download | wireguard-openbsd-a5959c1f05b823f268cddedb436dd24ebf69324d.tar.xz wireguard-openbsd-a5959c1f05b823f268cddedb436dd24ebf69324d.zip |
oflow
-rw-r--r-- | usr.bin/rpcgen/rpc_main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index b4faa61af64..ce756a3ca3e 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_main.c,v 1.3 1997/10/11 21:10:41 deraadt Exp $ */ +/* $OpenBSD: rpc_main.c,v 1.4 1999/12/04 21:58:31 deraadt Exp $ */ /* $NetBSD: rpc_main.c,v 1.9 1996/02/19 11:12:43 pk Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -32,7 +32,7 @@ #ifndef lint static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; -static char cvsid[] = "$OpenBSD: rpc_main.c,v 1.3 1997/10/11 21:10:41 deraadt Exp $"; +static char cvsid[] = "$OpenBSD: rpc_main.c,v 1.4 1999/12/04 21:58:31 deraadt Exp $"; #endif /* @@ -85,7 +85,7 @@ static char *cmdname; static char *svcclosetime = "120"; static char *CPP = "/usr/bin/cpp"; static char CPPFLAGS[] = "-C"; -static char pathbuf[MAXPATHLEN + 1]; +static char pathbuf[MAXPATHLEN]; static char *allv[] = { "rpcgen", "-s", "udp", "-s", "tcp", }; @@ -1047,8 +1047,9 @@ parseargs(argc, argv, cmd) if (++i == argc) { return (0); } - (void) strcpy(pathbuf, argv[i]); - (void) strcat(pathbuf, "/cpp"); + if (snprintf(pathbuf, sizeof pathbuf, + "%s/cpp", argv[i]) >= sizeof pathbuf) + usage(); CPP = pathbuf; cppDefined = 1; goto nextarg; |