From acc12f3e742c3c1f452f9243301e5214db83e303 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 19 Jul 2026 16:14:09 -1000 Subject: Cap and paginate the ref listings --- source/cgit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/cgit.c') diff --git a/source/cgit.c b/source/cgit.c index ce8b340..5fcd17f 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -257,6 +257,8 @@ static void config_cb(const char *name, const char *value) ctx.cfg.max_repodesc_len = atoi(value); else if (!strcmp(name, "max-blob-size")) ctx.cfg.max_blob_size = atoi(value); + else if (!strcmp(name, "max-ref-count")) + ctx.cfg.max_ref_count = atoi(value); else if (!strcmp(name, "max-repo-count")) { ctx.cfg.max_repo_count = atoi(value); if (ctx.cfg.max_repo_count <= 0) @@ -417,6 +419,7 @@ static void prepare_context(void) ctx.cfg.max_repo_count = 50; ctx.cfg.max_commit_count = 50; ctx.cfg.max_msg_len = 80; + ctx.cfg.max_ref_count = 200; /* refs beyond this paginate */ ctx.cfg.max_repodesc_len = 80; ctx.cfg.max_blob_size = 10 * 1024; /* 10 MB; bounds per-request memory */ ctx.cfg.max_stats = 0; -- cgit v2.8.0