From 2085a9e91187e89a1eed83b1243521cd5038ca19 Mon Sep 17 00:00:00 2001 From: grunfink Date: Wed, 2 Sep 2026 09:49:02 +0200 Subject: Skip notification files that are too big. --- data.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/data.c b/data.c index 279f7af..2529713 100644 --- a/data.c +++ b/data.c @@ -3529,12 +3529,18 @@ xs_dict *notify_get(snac *snac, const char *id) fn = xs_strip_i(fn); fn = xs_str_cat(fn, ".json"); - FILE *f; xs_dict *out = NULL; - if ((f = fopen(fn, "r")) != NULL) { - out = xs_json_load(f); - fclose(f); + struct stat st; + + if (stat(fn, &st) != -1) { + if (st.st_size < 100000) { + FILE *f; + if ((f = fopen(fn, "r")) != NULL) { + out = xs_json_load(f); + fclose(f); + } + } } return out; -- cgit