Close the newly-created FD if the pathname is too long.
Coverity: CID 1007204 Sponsored by: Netflix, Inc.
This commit is contained in:
parent
f1575af8e4
commit
4c766481d0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260544
@ -316,6 +316,7 @@ udom_open(const char *path, int flags)
|
|||||||
sou.sun_family = AF_UNIX;
|
sou.sun_family = AF_UNIX;
|
||||||
if ((len = strlcpy(sou.sun_path, path,
|
if ((len = strlcpy(sou.sun_path, path,
|
||||||
sizeof(sou.sun_path))) >= sizeof(sou.sun_path)) {
|
sizeof(sou.sun_path))) >= sizeof(sou.sun_path)) {
|
||||||
|
close(fd);
|
||||||
errno = ENAMETOOLONG;
|
errno = ENAMETOOLONG;
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user