diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2024-02-25 19:34:52 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-02-26 09:49:08 -0800 |
commit | 3f4c7a080510b8278c028cc7e220f310b3df9678 (patch) | |
tree | acbaa81e1fe9711b9d25ce0cb24e91cae858cc06 /builtin/commit.c | |
parent | 3c2a3fdc388747b9eaf4a4a4f2035c1c9ddb26d0 (diff) |
upload-pack: don't send null character in abort message to the client
Since 583b7ea31b (upload-pack/fetch-pack: support side-band
communication, 2006-06-21) the abort message sent by upload-pack in
case of possible repository corruption ends with a null character.
This can be seen in several test cases in 't5530-upload-pack-error.sh'
where 'grep <pattern> output.err' often reports "Binary file
output.err matches" because of that null character.
The reason for this is that the abort message is defined as a string
literal, and we pass its size to the send function as
sizeof(abort_msg), which also counts the terminating null character.
Use strlen() instead to avoid sending that terminating null character.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions