From 28f7d43290ef21cff191226e4164b0d19236a08e Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 12 Feb 2012 14:56:40 +0000 Subject: [PATCH] MFC r231054: In usr.bin/rpcgen/rpc_main.c, properly check the return value of strlcpy(), in addition to checking that of strlcat(). git-svn-id: svn://svn.freebsd.org/base/stable/8@231561 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.bin/rpcgen/rpc_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index fb3813f42..1125e1e71 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -1129,9 +1129,11 @@ parseargs(int argc, const char *argv[], struct commandline *cmd) if (++i == argc) { return (0); } - (void) strlcpy(pathbuf, argv[i], sizeof(pathbuf)); - if (strlcat(pathbuf, "/cpp", sizeof(pathbuf)) - >= sizeof(pathbuf)) { + if (strlcpy(pathbuf, argv[i], + sizeof(pathbuf)) >= sizeof(pathbuf) + || strlcat(pathbuf, "/cpp", + sizeof(pathbuf)) >= + sizeof(pathbuf)) { warnx("argument too long"); return (0); } -- 2.45.0