]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'sg/upload-pack-error-message-fix'
authorJunio C Hamano <gitster@pobox.com>
Tue, 5 Mar 2024 17:44:43 +0000 (09:44 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Mar 2024 17:44:43 +0000 (09:44 -0800)
An error message from "git upload-pack", which responds to "git
fetch" requests, had a trialing NUL in it, which has been
corrected.

* sg/upload-pack-error-message-fix:
  upload-pack: don't send null character in abort message to the client

upload-pack.c

index 2537affa90762228a19d305be749f410d5afb5dc..6e0d441ef523edaeca10ffdf2e13f8d52ee592d0 100644 (file)
@@ -463,7 +463,7 @@ static void create_pack_file(struct upload_pack_data *pack_data,
 
  fail:
        free(output_state);
-       send_client_data(3, abort_msg, sizeof(abort_msg),
+       send_client_data(3, abort_msg, strlen(abort_msg),
                         pack_data->use_sideband);
        die("git upload-pack: %s", abort_msg);
 }