diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
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.
Diffstat (limited to 'source/ui-plain.c')
-rw-r--r--source/ui-plain.c4
1 file changed, 2 insertions, 2 deletions
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);