diff options
| author | Kris Kennaway <kris@FreeBSD.org> | 2001-08-20 09:43:04 +0000 |
|---|---|---|
| committer | Kris Kennaway <kris@FreeBSD.org> | 2001-08-20 09:43:04 +0000 |
| commit | a0b13740e8aef81378272cc1fd2ae91a6ca89635 (patch) | |
| tree | 4d579f7484c7b9d591c125acca659924d585e681 | |
| parent | 3faf1df3a7e3cc265b6c7ae38e8b183a5bcc59ef (diff) | |
Notes
| -rw-r--r-- | usr.bin/rpcgen/rpc_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index 5c0752b8e9fd..30eb21cd444a 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -1236,8 +1236,12 @@ parseargs(argc, argv, cmd) if (++i == argc) { return (0); } - (void) strcpy(pathbuf, argv[i]); - (void) strcat(pathbuf, "/cpp"); + (void) strlcpy(pathbuf, argv[i], sizeof(pathbuf)); + if (strlcat(pathbuf, "/cpp", sizeof(pathbuf)) + >= sizeof(pathbuf)) { + warnx("argument too long"); + return (0); + } CPP = pathbuf; cppDefined = 1; goto nextarg; |
