From b75e3deb6a8d0860167e66a8f1e128dfec452c69 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 15 Jul 2026 14:05:37 -1000 Subject: Harden the blob view error paths A blob requested by ref with an unknown path fell through to the commit object and was served with a 200 instead of a 404, two error pages passed a null pointer to a %s format when the request carried no object id, and the error pages left the layout open. --- source/ui-plain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/ui-plain.c') diff --git a/source/ui-plain.c b/source/ui-plain.c index a2a4087..c041711 100644 --- a/source/ui-plain.c +++ b/source/ui-plain.c @@ -27,13 +27,13 @@ static int print_object(const struct object_id *oid, const char *path) type = odb_read_object_info(the_repository->objects, oid, &size); if (type == OBJ_BAD) { cgit_print_error_page(404, "Not found", "Not found"); - return 0; + return 1; } buf = odb_read_object(the_repository->objects, oid, &type, &size); if (!buf) { cgit_print_error_page(404, "Not found", "Not found"); - return 0; + return 1; } mimetype = get_mimetype_for_filename(path); -- cgit v2.8.0