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 '')
-rw-r--r--source/ui-blame.c5
1 file changed, 3 insertions, 2 deletions
diff --git a/source/ui-blame.c b/source/ui-blame.c
index 5c6f36e..1b9df88 100644
--- a/source/ui-blame.c
+++ b/source/ui-blame.c
@@ -229,9 +229,10 @@ static void print_object(const struct object_id *oid, const char *path,
html("</tr>\n</table>\n");
- cgit_print_layout_end();
-
cleanup:
+ /* The binary and oversized branches jump here with the layout still
+ * open, so close it on every path rather than only the normal one. */
+ cgit_print_layout_end();
free(buf);
}