diff options
author | dim <dim@FreeBSD.org> | 2012-02-05 20:55:38 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-02-05 20:55:38 +0000 |
commit | a0f02c441872647bb0c8ac64a70fed1005cdae8a (patch) | |
tree | befb41a7352c7b197dc6d7b0c5e59e8948ba473f /usr.bin/rpcgen | |
parent | 412d48f588d8c47157cb556845e0033c1ed663f5 (diff) | |
download | FreeBSD-src-a0f02c441872647bb0c8ac64a70fed1005cdae8a.zip FreeBSD-src-a0f02c441872647bb0c8ac64a70fed1005cdae8a.tar.gz |
In usr.bin/rpcgen/rpc_main.c, properly check the return value of
strlcpy(), in addition to checking that of strlcat().
MFC after: 1 week
Diffstat (limited to 'usr.bin/rpcgen')
-rw-r--r-- | usr.bin/rpcgen/rpc_main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index c9b2e7a..75ed6e5 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -1125,9 +1125,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); } |