Fix overflow if someone has more than 100 groups somehow.

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
Slendi 2023-05-10 17:23:03 +03:00
parent e3cdfce3aa
commit f7335c8761
No known key found for this signature in database
GPG Key ID: F8405BA38DE1E10D

2
sus.c
View File

@ -19,7 +19,7 @@ read_ids()
{
FILE *f = fopen("/etc/sus", "r");
if (!f) return 0;
while (!feof(f))
while (!feof(f) && ids_len < 99)
fscanf(f, "%lld", &ids[ids_len++]);
if (ids_len == 0) return 0;
return 1;