bzip2recover (v.1.0.6) creates wrong headers (of rec* files)

Bug #1169677 reported by Aleks-ger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bzip2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

I found a bug in bzip2recover 1.0.6.

Assume you have a huge (2 GB) perfect myfile.bz2.
Using bzip2recover myfile.bz2 gives rec00001myfile.bz2 (and more files rec*.bz2).
The fourth Header Byte is always wrong, see below!
It seems to have low effect, but confused me understandig the file-format,
while writing a tool for 'healing' bad downloaded huge bz2-files.
The 4th byte in header wrong, for sure.

WHAT I MADE:
$ head -c 8 myfile.bz2
BZh11AY&
$ file myfile.bz2
myfile.bz2: bzip2 compressed data, block size = 100k
$ file rec00001myfile.bz2
rec00001rec00001saarpart.bz2: bzip2 compressed data, block size = 900k
$ head -c 8 rec00001myfile.bz2
BZh91AY&
$ bunzip2 rec00001myfile.bz2 ; ls -l rec00001myfile
-rw------- 1 me None 99938 15. Apr 19:00 rec00001myfile

This is close to 100,000 Byte, which is idicated by block size = 100k.
It would be right to use the original Header, not constant "BZh9".
Please comment on that.

MY SYSTEM:
$ bzip2recover --version
bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.
$ bzip2 -V
bzip2, a block-sorting file compressor. Version 1.0.6, 6-Sept-2010.
$ cat /proc/version
Linux version 3.2.0-39-generic (buildd@lamiak) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #62-Ubuntu SMP Thu Feb 28 00:28:53 UTC 2013

also checked on Cygwin, same result
$ cat /proc/version
CYGWIN_NT-6.1-WOW64 version 1.7.17(0.262/5/3)
(<email address hidden>) (gcc version 4.5.3 20110428 (Fedora Cygwin
4.5.3-4) (GCC) ) 2012-10-19 14:39

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.