git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH decompress BUG] Fix decompress_next_from() wrong argument value

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Jan 12, 2008, 07:06 UTC
Message-ID
<e5bfff550801112306g6b8127dft80484c9fd8554992@mail.gmail.com>
In-Reply-To
<7vfxx3290v.fsf@gitster.siamese.dyndns.org>
On Jan 12, 2008 1:16 AM, Junio C Hamano <gitster@pobox.com> wrote:
>
> Next time around, please mark the patch on the Subject: line to
> be squashed to your earlier [PATCH 5/6] before [PATCH 6/6].
>

Very sorry for wasting your time I should have been more clear that it was a bug in the new series. And of course this series is not to be applied to stable git.

The only two points in the current code in master that I would like to report to you are a _possible_ missing inflateEnd() before a new inflateInit(), but I am not confident with that part of code to judge if is a bug or not, anyway that's the _possible_ diff.

diff --git a/http-push.c b/http-push.c
index 55d0c94..e0a4cc6 100644
--- a/http-push.c
+++ b/http-push.c
@@ -307,6 +307,7 @@ static void start_fetch_loose(struct
transfer_request *request)
 	/* Reset inflate/SHA1 if there was an error reading the previous temp
 	   file; also rewind to the beginning of the local file. */
 	if (prev_read == -1) {
+		inflateEnd(&request->stream);
 		memset(&request->stream, 0, sizeof(request->stream));
 		inflateInit(&request->stream);
 		SHA1_Init(&request->c);
diff --git a/http-walker.c b/http-walker.c
index 2c37868..a18067c 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -182,6 +182,7 @@ static void start_object_request(struct walker *walker,
 	/* Reset inflate/SHA1 if there was an error reading the previous temp
 	   file; also rewind to the beginning of the local file. */
 	if (prev_read == -1) {
+		inflateEnd(&obj_req->stream);
 		memset(&obj_req->stream, 0, sizeof(obj_req->stream));
 		inflateInit(&obj_req->stream);
 		SHA1_Init(&obj_req->c);



I have not created a proper patch becuase I don't know if the missing
inflateEnd(), it is a bug or not. The above diff it's just a way to
point you quickly and hopefully clearly to the interested code .


Sorry again for the trouble I had caused to you. For sure I will be
much more careful in the future to be clear in the subjects. And also
sorry for my rant but it was very late and I was tired after fighting
with that _my_ bug.

Marco
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “Fix decompress_next_from() wrong argument value”
  1. Fix decompress_next_from() wrong argument valueMarco Costalba, Jan 11, 2008
  2. Junio C HamanoJan 12, 2008
  3. Marco CostalbaJan 12, 2008
  4. Junio C HamanoJan 12, 2008
  5. Marco CostalbaJan 12, 2008
  6. Junio C HamanoJan 12, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.