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
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user