Re: [PATCH v2] packfile: Correct zlib buffer handling

2018-06-13 Thread Junio C Hamano
Jeremy Linton writes: >> Here is what I tentatively came up with. >> >> -- >8 -- >> From: Jeremy Linton >> Date: Wed, 13 Jun 2018 09:22:07 -0500 >> Subject: [PATCH] packfile: correct zlib buffer handling >> >> The buffer being passed to zlib includes a NUL terminator that git >> ... >> + >>

Re: [PATCH v2] packfile: Correct zlib buffer handling

2018-06-13 Thread Jeremy Linton
Hi, On Wed, Jun 13, 2018 at 1:38 PM, Junio C Hamano wrote: > Eric Sunshine writes: > >>> + buffer[size] = 0; /* assure that the buffer is still terminated */ >> >> I think we normally use '\0' for NUL on this project rather than simply 0. >> >> The comment is also effectively pure noise si

Re: [PATCH v2] packfile: Correct zlib buffer handling

2018-06-13 Thread Eric Sunshine
On Wed, Jun 13, 2018 at 2:32 PM Junio C Hamano wrote: > Eric Sunshine writes: > > On this project, the character mnemonic "NUL" is typically used, not > > "null" or "NULL" (which is typically reserved for pointers), so: > > s/null/NUL/g > > Correct but I did not think it is a per-project preferen

Re: [PATCH v2] packfile: Correct zlib buffer handling

2018-06-13 Thread Junio C Hamano
Eric Sunshine writes: >> + buffer[size] = 0; /* assure that the buffer is still terminated */ > > I think we normally use '\0' for NUL on this project rather than simply 0. > > The comment is also effectively pure noise since it merely repeats > what the code already states clearly (especia

Re: [PATCH v2] packfile: Correct zlib buffer handling

2018-06-13 Thread Junio C Hamano
Eric Sunshine writes: > A couple comments if you happen to re-roll... > > On Wed, Jun 13, 2018 at 10:22 AM Jeremy Linton > wrote: >> The buffer being passed to zlib includes a null terminator that > > On this project, the character mnemonic "NUL" is typically used, not > "null" or "NULL" (which

Re: [PATCH v2] packfile: Correct zlib buffer handling

2018-06-13 Thread Eric Sunshine
A couple comments if you happen to re-roll... On Wed, Jun 13, 2018 at 10:22 AM Jeremy Linton wrote: > The buffer being passed to zlib includes a null terminator that On this project, the character mnemonic "NUL" is typically used, not "null" or "NULL" (which is typically reserved for pointers),

[PATCH v2] packfile: Correct zlib buffer handling

2018-06-13 Thread Jeremy Linton
The buffer being passed to zlib includes a null terminator that git needs to keep in place. unpack_compressed_entry() attempts to detect the case that the source buffer hasn't been fully consumed by checking to see if the destination buffer has been over consumed. This causes a problem, that more