{"thread":{"id":"66812","subject":"zlib 1.4 compatible?","startedAt":"2026-11-09T14:14:27Z","lastAt":"2026-11-11T13:59:03Z","messageCount":2,"participants":["Sven Strickroth","Patrick Steinhardt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"557942","messageId":"9c54aa5a-f359-4db8-a9fd-d86c48b73ff0@cs-ware.de","threadId":"66812","inReplyTo":null,"subject":"zlib 1.4 compatible?","fromName":"Sven Strickroth","fromEmail":"email@cs-ware.de","sentAt":"2026-11-09T14:14:27Z","receivedAt":"2026-11-09T14:14:27Z","isPatch":false,"sender":{"key":"email@cs-ware.de","avatar":"https://avatars.githubusercontent.com/u/428133?v=4"},"body":"Hi,\n\nzlib 1.4 was released recently to fix security issues, however, at the same time it introduces potentially breaking changes (cf. <https://github.com/madler/zlib/releases/tag/v1.4>) such as:\n\n> Raw deflate that completes exactly at the end of the output buffer now returns Z_STREAM_END instead of Z_OK, as documented.\n\nDoes this affect glib?\n\nBest,\n Sven\n\n"},{"id":"558212","messageId":"avR0pxqREJGwDS86@pks.im","threadId":"66812","inReplyTo":"9c54aa5a-f359-4db8-a9fd-d86c48b73ff0@cs-ware.de","subject":"Re: zlib 1.4 compatible?","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-11-11T13:59:03Z","receivedAt":"2026-11-11T13:59:03Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Nov 09, 2026 at 03:14:27PM +0100, Sven Strickroth wrote:\n> Hi,\n> \n> zlib 1.4 was released recently to fix security issues, however, at the same\n> time it introduces potentially breaking changes (cf.\n> <https://github.com/madler/zlib/releases/tag/v1.4>) such as:\n> \n> > Raw deflate that completes exactly at the end of the output buffer now\n> returns Z_STREAM_END instead of Z_OK, as documented.\n> \n> Does this affect glib?\n\nYou probably mean Git, not glib.\n\nSo this breaking change is only contained to raw deflate, and we only\nuse that in \"archive-zip.c\". And as `Z_STREAM_END` can only trigger with\n`Z_FINISH` there's only two loops here that we need to vet:\n\n\tbuffer = xmalloc(maxsize);\n        ...\n\n\tdo {\n\t\tresult = git_deflate(&stream, Z_FINISH);\n\t} while (result == Z_OK);\n\nThis one shoulud be fine, as we estimate the maximum bounds and then\ndecompress everything into that buffer. So even when we see Z_STREAM_END\nwe'd write the results into that buffer as expected.\n\nAnd the second one:\n\n\tif (result != Z_STREAM_END) {\n\t\tfree(buffer);\n\t\treturn NULL;\n\t}\n\n\tdo {\n\t\tresult = git_deflate(&zstream, Z_FINISH);\n\t\tif (result != Z_OK && result != Z_STREAM_END)\n\t\t\tdie(\"deflate error (%d)\", result);\n\n\t\tout_len = zstream.next_out - compressed;\n\t\tif (out_len > 0) {\n\t\t\twrite_or_die(1, compressed, out_len);\n\t\t\tcompressed_size += out_len;\n\t\t\tzstream.next_out = compressed;\n\t\t\tzstream.avail_out = sizeof(compressed);\n\t\t}\n\t} while (result != Z_STREAM_END);\n\nThis one looks fine to me, as we process the result just fine on\nZ_STREAM_END.\n\nSo I don't think that zlib 1.4 causes any issues for us.\n\nPatrick\n\n"}]}