From d638da38e88ff01cfc7fa8427b8d8525be1eae21 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 8 Aug 2026 12:37:18 -1000 Subject: Bound the search and cache key a request can ask --- source/cgit.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/cgit.h') diff --git a/source/cgit.h b/source/cgit.h index 8f10068..b05876e 100644 --- a/source/cgit.h +++ b/source/cgit.h @@ -55,6 +55,14 @@ #define BIT(x) (1U << (x)) +/* + * Longest search string a request may supply. The filter bar matches its + * query against every item a page lists, so this bounds the work one request + * can ask for. It is not a configuration knob, in the same way as the ofs + * ceiling in querystring_cb. + */ +#define CGIT_MAX_SEARCH_LEN 512 + typedef void (*configfn)(const char *name, const char *value); typedef void (*filepair_fn)(struct diff_filepair *pair); typedef void (*linediff_fn)(char *line, int len); -- cgit 2.12.1