mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 08:09:08 +00:00
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;
|
||||
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