diff options
| author | grunfink <grunfink@comam.es> | 2026-09-02 09:49:02 +0200 |
|---|---|---|
| committer | grunfink <grunfink@comam.es> | 2026-09-02 09:49:02 +0200 |
| commit | 2085a9e91187e89a1eed83b1243521cd5038ca19 (patch) | |
| tree | b66b03dc9dc6d4f7210e0919f98c27fce0759b2a /data.c | |
| parent | dbff0032ecf575b9bfec9a0a3a9800dcdf4bd33d (diff) | |
Skip notification files that are too big.
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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; |