Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Feb 2012 14:56:50 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r231562 - stable/7/usr.bin/rpcgen
Message-ID:  <201202121456.q1CEuoOs089200@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sun Feb 12 14:56:50 2012
New Revision: 231562
URL: http://svn.freebsd.org/changeset/base/231562

Log:
  MFC r231054:
  
  In usr.bin/rpcgen/rpc_main.c, properly check the return value of
  strlcpy(), in addition to checking that of strlcat().

Modified:
  stable/7/usr.bin/rpcgen/rpc_main.c
Directory Properties:
  stable/7/usr.bin/rpcgen/   (props changed)

Modified: stable/7/usr.bin/rpcgen/rpc_main.c
==============================================================================
--- stable/7/usr.bin/rpcgen/rpc_main.c	Sun Feb 12 14:56:40 2012	(r231561)
+++ stable/7/usr.bin/rpcgen/rpc_main.c	Sun Feb 12 14:56:50 2012	(r231562)
@@ -1129,9 +1129,11 @@ parseargs(int argc, const char *argv[], 
 					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);
 					}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202121456.q1CEuoOs089200>