summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.cgi
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2026-08-12 08:03:12 +0000
committerJunio C Hamano <gitster@pobox.com>2026-08-12 09:05:49 -0700
commitf8121b74798bd52ea6af99f70cb3bace2b44e953 (patch)
treeb643b15b0a062e611a7b0b44909ede43850ea765 /gitweb/gitweb.cgi
parent47568fee949526145bc2a87cd253d8df48b61efc (diff)
reftable/block: check deflateInit() return value
block_writer_init() allocates a z_stream and calls deflateInit() to prepare it for compressing log records. The return value of deflateInit() is silently discarded. If zlib initialization fails (e.g., Z_MEM_ERROR when the system is under memory pressure), the z_stream is left in an undefined state. Subsequent deflate() calls in block_writer_finish() then operate on this uninitialized stream. Current zlib/zlib-ng versions handle such a stream gracefully, by returning `Z_STREAM_ERROR`, so in practice it would likely not result in catastrophic error. The function already uses REFTABLE_ZLIB_ERROR for deflate() failures later in the code path, so returning the same error code for deflateInit() failure is consistent. Pointed out by Coverity. Assisted-by: Claude Opus 4.6 Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.cgi')
0 files changed, 0 insertions, 0 deletions