From 75f40779607ea79f20441c7fb46744d04ee2c7ae Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 3 Feb 2018 03:09:08 -0800 Subject: socket-util: fix getpeergroups() assert(fd) (#8080) Don't assert on zero-value fds. Fixes #8075. --- src/basic/socket-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/basic/socket-util.c') diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index 2c70cade14..bd3cf6f869 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -1008,7 +1008,7 @@ int getpeergroups(int fd, gid_t **ret) { socklen_t n = sizeof(gid_t) * 64; _cleanup_free_ gid_t *d = NULL; - assert(fd); + assert(fd >= 0); assert(ret); for (;;) { -- cgit v1.2.3