Skip to content

Read concatenated bzip2 streams - #24690

Open
kairosci wants to merge 1 commit into
php:masterfrom
kairosci:fix/gh-24170-bzip2-concatenated-streams
Open

kairosci wants to merge 1 commit into
php:masterfrom
kairosci:fix/gh-24170-bzip2-concatenated-streams

Conversation

@kairosci

Copy link
Copy Markdown
Contributor

Fixes #24170 by reading concatenated bzip2 members in the stream wrapper and bzopen(), while preserving the exported API and trailing-data behavior.

Adds regression coverage; bzip2 tests pass in debug ZTS and ASan/UBSan builds with applicable skips.

@kairosci

Copy link
Copy Markdown
Contributor Author

The macOS job fails during compilation because OpenSSL 4.1 deprecates ASN1_STRING_set() and ASN1_STRING_length(), and deprecation warnings are treated as errors. Tests never start. This is unrelated to the bzip2 changes and is already addressed separately by #24686.

Failing job: https://github.com/php/php-src/actions/runs/40205742173/job/121206203893

@kairosci

Copy link
Copy Markdown
Contributor Author

@ndossche As soon as you can, could you take a look at it ? Thanks

@ndossche
ndossche self-requested a review October 31, 2026 23:21
@kairosci
kairosci force-pushed the fix/gh-24170-bzip2-concatenated-streams branch from 0e63671 to ec720cd Compare November 1, 2026 13:27
@kairosci
kairosci requested a review from derickr as a code owner November 1, 2026 13:27
@kairosci
kairosci force-pushed the fix/gh-24170-bzip2-concatenated-streams branch 2 times, most recently from 353ac64 to e8dba59 Compare November 2, 2026 21:18
@kairosci

Copy link
Copy Markdown
Contributor Author

Written with ChatGPT. This response summarizes the changes and verification in the current PR head.

Thanks for checking these API and error cases. I updated UPGRADING to say explicitly that bzdecompress() still handles only the first member, while the stream wrapper and bzopen() read concatenated members.

I also added gh24170_errors.phpt: bzread() returns false and reports the damaged later member, and the stream wrapper raises a warning instead of silently presenting the truncated result as complete. The full CI matrix is green on the current head. Please take another look.

@kairosci
kairosci force-pushed the fix/gh-24170-bzip2-concatenated-streams branch from e8dba59 to 5876e2d Compare November 12, 2026 03:02
@kairosci
kairosci requested a review from TimWolla as a code owner November 12, 2026 20:31
@kairosci
kairosci force-pushed the fix/gh-24170-bzip2-concatenated-streams branch 3 times, most recently from be9c031 to c0b32af Compare November 16, 2026 17:48
@kairosci kairosci changed the title Fix GH-24170: read concatenated bzip2 streams Read concatenated bzip2 streams Nov 16, 2026
@kairosci
kairosci force-pushed the fix/gh-24170-bzip2-concatenated-streams branch from c0b32af to 08bc254 Compare November 16, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bzip2.decompress stream wrapper truncates valid bz2 files from pbzip2

1 participant