]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
socket-util: fix getpeergroups() assert(fd) (#8080)
authorVito Caputo <vcaputo@pengaru.com>
Sat, 3 Feb 2018 11:09:08 +0000 (03:09 -0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 3 Feb 2018 11:09:08 +0000 (20:09 +0900)
Don't assert on zero-value fds.

Fixes #8075.

src/basic/socket-util.c

index 2c70cade14dceaacde7fcc18b9a6159467429063..bd3cf6f86982e413f35bb572f5598775f4de0ad4 100644 (file)
@@ -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 (;;) {