diff options
author | Aiden Gall <aiden@aidengall.xyz> | 2023-12-13 17:16:34 +0000 |
---|---|---|
committer | Aiden Gall <aiden@aidengall.xyz> | 2023-12-13 18:14:21 +0000 |
commit | e97ffa9a4471fd0182017b4d6a2d406a9de03812 (patch) | |
tree | 72dc68c835c5c53a76e3fda97db858e7a8d972fb | |
parent | 45bff732e97b22ebdcaf20b98ceb0666b368d1c4 (diff) |
prevent potential undefined behaviour
-rw-r--r-- | simplebl.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -105,6 +105,8 @@ check_group(void) glist_size = getgroups(0, NULL); if (errno) die("getgroups: %s\n", strerror(errno)); + if (!glist_size) + die("getgroups: User has no supplementary groups\n"); glist = calloc(glist_size, sizeof(*glist)); if (!glist) die("check_group: Out of memory\n"); |