aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlendi <slendi@socopon.com>2023-05-10 17:23:03 +0300
committerSlendi <slendi@socopon.com>2023-05-10 17:23:03 +0300
commitf7335c87614b1a444b950c0f8e4247b1c6bdb236 (patch)
treef98c2ff619aaac056153696e7031731178d3ac8a
parente3cdfce3aa17d0d0463ce1a733a08203910bd338 (diff)
Fix overflow if someone has more than 100 groups somehow.
Signed-off-by: Slendi <slendi@socopon.com>
-rw-r--r--sus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sus.c b/sus.c
index 35eff58..2c958d2 100644
--- a/sus.c
+++ b/sus.c
@@ -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;