From b5bbbe902b000d3e7263d46b0d081c3b966bcd20 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 14 Oct 2026 23:03:47 -1000 Subject: Check the id before the page chrome resolves it The chrome renders on an error page too, where the id had just been refused for using the wider revision syntax, and then looked it up anyway. A :/pattern id walks the whole history for a match. --- source/ui-shared.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/ui-shared.c') diff --git a/source/ui-shared.c b/source/ui-shared.c index f3d815f..a0a0664 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -419,6 +419,10 @@ static const struct object_id *pinned_oid(void) if (!ctx.repo || !ctx.qry.has_oid || !ctx.qry.oid || !ctx.qry.head) return NULL; + // The chrome renders on an error page too, where the id was refused + // before any command could look it up, so it is checked here as well. + if (!cgit_valid_rev(ctx.qry.oid)) + return NULL; if (repo_get_oid(the_repository, ctx.qry.oid, &oid) || repo_get_oid(the_repository, ctx.qry.head, &head_oid)) return NULL; -- cgit 2.12.1