Close the newly-created FD if the pathname is too long.

Coverity:	CID 1007204
Sponsored by:	Netflix, Inc.
This commit is contained in:
Adrian Chadd 2014-01-11 15:01:30 +00:00
parent f1575af8e4
commit 4c766481d0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260544

View File

@ -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);
}