svn commit: r260544 - head/bin/cat

Adrian Chadd adrian at FreeBSD.org
Sat Jan 11 15:01:31 UTC 2014


Author: adrian
Date: Sat Jan 11 15:01:30 2014
New Revision: 260544
URL: http://svnweb.freebsd.org/changeset/base/260544

Log:
  Close the newly-created FD if the pathname is too long.
  
  Coverity:	CID 1007204
  Sponsored by:	Netflix, Inc.

Modified:
  head/bin/cat/cat.c

Modified: head/bin/cat/cat.c
==============================================================================
--- head/bin/cat/cat.c	Sat Jan 11 14:56:04 2014	(r260543)
+++ head/bin/cat/cat.c	Sat Jan 11 15:01:30 2014	(r260544)
@@ -316,6 +316,7 @@ udom_open(const char *path, int flags)
 		sou.sun_family = AF_UNIX;
 		if ((len = strlcpy(sou.sun_path, path,
 		    sizeof(sou.sun_path))) >= sizeof(sou.sun_path)) {
+			close(fd);
 			errno = ENAMETOOLONG;
 			return (-1);
 		}


More information about the svn-src-head mailing list