lzip-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lzip-bug] silent data corruption by lzip-1.2-pre1


From: Antonio Diaz Diaz
Subject: Re: [Lzip-bug] silent data corruption by lzip-1.2-pre1
Date: Fri, 05 Dec 2008 16:19:51 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

John Reiser wrote:
Here is an example of lzip-1.2-pre1 corrupting data silently.

$ ./lzip -s30 foo   # compress

Thank you for finding this bug. The maximum safe value for -s is 29, not 30. I didn't find it myself because a machine with more than 6GiB of RAM is needed to test -s30 (mine has only 512MiB). Please test the following patch:

----------------------------------------------------
diff -urdN ../old_src/lzip.h ./lzip.h
--- ../old_src/lzip.h   2008-11-20 19:48:21.000000000 +0100
+++ ./lzip.h    2008-12-05 15:48:58.000000000 +0100
@@ -49,7 +49,7 @@


 const int min_dictionary_bits = 12;
-const int max_dictionary_bits = 30;
+const int max_dictionary_bits = 29;
 const int literal_context_bits = 3;
 const int pos_state_bits = 2;
 const int pos_states = 1 << pos_state_bits;
----------------------------------------------------


   User documentation "./lzip --help" is incorrect for "-s".

It is incomplete because "lzip --help" is intended as a fast reminder of lzip usage. For a more complete info you can read the fine manual:

`--dictionary-size=SIZE'
`-s SIZE'
     Set the dictionary size in bytes. Dictionary size is always a
     power of two. You may specify it as the number of bits to use or
     as a size between 4KiB and 1GiB. If the specified size is not a
     power of two, it is rounded upwards.


A corrected version will be released shortly.


Best regards,
Antonio.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]