From: Mark Wielaard <mark@klomp.org>
To: bzip2-devel@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] bzip2recover: Make sure to not process more than BZ_MAX_HANDLED_BLOCKS
Date: Thu, 28 May 2026 16:54:07 +0200 [thread overview]
Message-ID: <20260528145407.293768-1-mark@klomp.org> (raw)
There is an off-by-one in the check before calling tooManyBlocks. This
causes the scanning loop to run one more time and cause a possible
read or write one past the global bStart, bEnd, rbStart and rbEnd
buffers. There are no known exploits of this issue and you will need
to compile with something like gcc -fsanitize=address (ASAN
AddressSanitizer) to observe the faulty read/write.
This has been assigned CVE-2026-42250.
---
bzip2recover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bzip2recover.c b/bzip2recover.c
index a8131e0611ec..4b1c219034c6 100644
--- a/bzip2recover.c
+++ b/bzip2recover.c
@@ -402,7 +402,7 @@ Int32 main ( Int32 argc, Char** argv )
rbEnd[rbCtr] = bEnd[currBlock];
rbCtr++;
}
- if (currBlock >= BZ_MAX_HANDLED_BLOCKS)
+ if (currBlock >= BZ_MAX_HANDLED_BLOCKS - 1)
tooManyBlocks(BZ_MAX_HANDLED_BLOCKS);
currBlock++;
--
2.54.0
reply other threads:[~2026-05-28 14:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260528145407.293768-1-mark@klomp.org \
--to=mark@klomp.org \
--cc=bzip2-devel@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).