Public bug reported:

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)
(cori...@calimero.vinschen.de) (gcc version 4.5.3 20110428 (Fedora Cygwin
4.5.3-4) (GCC) ) 2012-10-19 14:39

** Affects: bzip2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1169677

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bzip2/+bug/1169677/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to