bzip2.decompress stream wrapper truncates valid bz2 files from pbzip2
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 57/100
Direzione di ricerca
Start by comparing the compress.bzip2:// wrapper path with the bzip2.decompress stream filter, using the provided PHP example as a reproducer. Trace where concatenated-stream handling differs and add a regression test for the wrapper with two concatenated bz2 streams; done means both reads return 900004 bytes without truncation.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
pbzip2 slices a file into 900000 byte blocks and then concatenates the streams. The default PHP behavior for using libbzip2 stops after the first concatenated stream without warning. This results in silently truncated reads.
The following code:
<?php
$f = tempnam(sys_get_temp_dir(), 'bz');
file_put_contents($f, bzcompress(str_repeat('a', 900000)) . bzcompress('tail')); // two streams
echo strlen(file_get_contents("compress.bzip2://$f")), "\n"; // 900000 if truncated, 900004 if not
$fp = fopen($f, 'rb');
stream_filter_append($fp, 'bzip2.decompress', STREAM_FILTER_READ, ['concatenated' => true]);
echo strlen(stream_get_contents($fp)), "\n"; // 900004
Resulted in this output:
900000
900004
But I expected this output instead:
900004
900004
PHP Version
PHP 8.5.11 (cli) (built: Sep 24 2026 14:38:36) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.5.11, Copyright (c) Zend Technologies
with Zend OPcache v8.5.11, Copyright (c), by Zend Technologies
Operating System
Debian 12.15
- Lingua principale
- C
- Stelle
- 40.7k
- Fork
- 8.3k
- Merge medio
- 2g 16h
- PR unite (30g)
- 151
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di php/php-src
-
sapi/fpm/tests/tester.inc can send SIGUSR2 to pid 0, killing run-tests.phpForse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaBug Status: Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
zend_set_local_var() overwrites existing compiled variable (CV) zval without calling zval_ptr_dtor()Forse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaBug Status: Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Case-insensitive substr_compare, ksort, krsort are still locale-dependentForse già presa @lazerg l’ha presa 3 giorni fa. ApertaBug Extension: standard Status: Verified
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
php/php-src#24552 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
master: part of the mbstring bailout fix got lost in a mergeForse già presa @lazerg l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Add `CPC_TAKE_TILL_CHARS`Apertadifficulty: easy
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
performance solver
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ChefKissInc/Inferno#319 ·
-
llvm-tools
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
llvm/llvm-project#235522 ·
I maintainer di solito rispondono entro 1 giorno