From 69d775b00cbe4c7be49660d4290d4983d610690a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:22:44 -0700 Subject: Refuse a dumb object request without a goto --- source/ui-clone.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/ui-clone.c') diff --git a/source/ui-clone.c b/source/ui-clone.c index 8f3439e..bdfbdf7 100644 --- a/source/ui-clone.c +++ b/source/ui-clone.c @@ -156,8 +156,10 @@ void cgit_clone_objects(void) { char *path; - if (!ctx.qry.path) - goto err; + if (!ctx.qry.path) { + cgit_print_error_page(400, "Bad Request", "Bad request"); + return; + } if (!strcmp(ctx.qry.path, "info/packs")) { print_pack_info(); @@ -172,10 +174,6 @@ void cgit_clone_objects(void) path = repo_git_path(the_repository, "objects/%s", ctx.qry.path); send_file(path); free(path); - return; - -err: - cgit_print_error_page(400, "Bad Request", "Bad request"); } /* -- cgit