Re: [PATCH v4] receive-pack.c: consolidate find header logic
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 5, 2022, 20:10 UTC
- Message-ID
- <xmqqczl6hrk5.fsf@gitster.g>
- In-Reply-To
- <pull.1125.v4.git.git.1641396098056.gitgitgadget@gmail.com>
"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 11 quoted lines
> Changes since v4:
>
> * added NEEDSWORK block detailing what needs to be done to clean up
> find_header_mem
> ...
> - while (line) {
> ++ /*
> ++ * NEEDSWORK: Between line[0] and msg[len], there may not be a LF nor NUL
> ++ * at all, and strchrnul() will scan beyond the range we were given
> ++ * Make this operation safer and abide by the contract to only read up to len.
> ++ */This sounds unnecessarily alarming. Can't we also explain that the current callers are safe?