Author: dim
Date: Sun Feb 12 14:56:40 2012
New Revision: 231561
URL: http://svn.freebsd.org/changeset/base/231561

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/8/usr.bin/rpcgen/rpc_main.c
Directory Properties:
  stable/8/usr.bin/rpcgen/   (props changed)

Modified: stable/8/usr.bin/rpcgen/rpc_main.c
==============================================================================
--- stable/8/usr.bin/rpcgen/rpc_main.c  Sun Feb 12 14:56:31 2012        
(r231560)
+++ stable/8/usr.bin/rpcgen/rpc_main.c  Sun Feb 12 14:56:40 2012        
(r231561)
@@ -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);
                                        }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to