public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/bzip3] epel8: Fix compressing streams of size being a multiple of bzip3 stream block size
@ 2026-09-08  9:11 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-09-08  9:11 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/bzip3
Branch : epel8
Commit : c48205a569958d76eab1ded1aced081efefed209
Author : Petr Písař <ppisar@redhat.com>
Date   : 2026-09-08T11:10:46+02:00
Stats  : +32/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/bzip3/c/c48205a569958d76eab1ded1aced081efefed209?branch=epel8

Log:
Fix compressing streams of size being a multiple of bzip3 stream block size

---
diff --git a/bzip3-1.5.3-fix-175.patch b/bzip3-1.5.3-fix-175.patch
new file mode 100644
index 0000000..c903d58
--- /dev/null
+++ b/bzip3-1.5.3-fix-175.patch
@@ -0,0 +1,26 @@
+From 3c60c830d14f51a905fea92c6b9ffe51d7fd3742 Mon Sep 17 00:00:00 2001
+From: Kamila Szewczyk <k@iczelia.net>
+Date: Wed, 22 Jul 2026 15:19:51 +0200
+Subject: [PATCH] fix #175
+
+---
+ src/libbz3.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/libbz3.c b/src/libbz3.c
+index 3818c65..2b9c43f 100644
+--- a/src/libbz3.c
++++ b/src/libbz3.c
+@@ -910,8 +910,7 @@ BZIP3_API int bz3_compress(u32 block_size, const u8 * const in, u8 * out, size_t
+     // Compress and write the blocks.
+     size_t in_offset = 0;
+     for (u32 i = 0; i < n_blocks; i++) {
+-        s32 size = block_size;
+-        if (i == n_blocks - 1) size = in_size % block_size;
++        s32 size = (s32)(i == n_blocks - 1 ? in_size - in_offset : block_size);
+         memcpy(compression_buf, in + in_offset, size);
+         s32 out_size_block = bz3_encode_block(state, compression_buf, size);
+         if (bz3_last_error(state) != BZ3_OK) {
+-- 
+2.55.0
+

diff --git a/bzip3.spec b/bzip3.spec
index 895f74d..d33bd31 100644
--- a/bzip3.spec
+++ b/bzip3.spec
@@ -62,6 +62,10 @@ Patch7:         bzip3-1.4.0-Fix-memory-leak-by-compression_buf-in-bz3_decompress
 # Fix decompressing large incompressible streams, in upstream after 1.5.3,
 # <https://github.com/iczelia/bzip3/issues/174>
 Patch8:         bzip3-1.5.3-fix-174.patch
+# Fix compressing streams of size being a multiple of bzip3 stream block size,
+# in upstream after 1.5.3,
+# <https://github.com/iczelia/bzip3/issues/175>
+Patch9:         bzip3-1.5.3-fix-175.patch
 BuildRequires:  autoconf
 BuildRequires:  autoconf-archive
 BuildRequires:  automake
@@ -185,6 +189,8 @@ fi
 %changelog
 * Tue Sep 08 2026 Petr Pisar <ppisar@redhat.com> - 1.3.1-5
 - Fix decompressing large incompressible streams (upstream GH#174)
+- Fix compressing streams of size being a multiple of bzip3 stream block size
+  (upstream GH#175)
 
 * Wed Apr 30 2025 Petr Pisar <ppisar@redhat.com> - 1.3.1-4
 - Improve memory estimation in bz3_compress()

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-08  9:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-08  9:11 [rpms/bzip3] epel8: Fix compressing streams of size being a multiple of bzip3 stream block size 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox