From 4c766481d0ee902c5fcdb7f5dc3c70819387f890 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sat, 11 Jan 2014 15:01:30 +0000 Subject: [PATCH] Close the newly-created FD if the pathname is too long. Coverity: CID 1007204 Sponsored by: Netflix, Inc. --- bin/cat/cat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 0daac7caec70..f724cb0b8b9a 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -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); }