From db5bb2d6932490ee8b00bda4977d8335cb5ef60b Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 26 Aug 2026 19:41:30 -1000 Subject: Null-terminate the stats pathspec argv --- source/ui-stats.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/ui-stats.c') diff --git a/source/ui-stats.c b/source/ui-stats.c index f1a4d65..182cc06 100644 --- a/source/ui-stats.c +++ b/source/ui-stats.c @@ -247,7 +247,10 @@ static struct string_list collect_stats(const struct cgit_period *period) struct string_list authors; struct rev_info rev; struct commit *commit; - const char *argv[] = {NULL, ctx.qry.head, NULL, NULL}; + // setup_revisions reads the entries after the double dash up to a + // NULL, past the count, so the sentinel has to stay even when the + // path fills the slot before it. + const char *argv[] = {NULL, ctx.qry.head, NULL, NULL, NULL}; int argc = 2; time_t since; struct tm tm; -- cgit 2.12.1