Commit Graph

26 Commits

Author SHA1 Message Date
Jean-Pierre André
1bc996f52f Avoided information leak when processing garbled compressed data
When a compressed file has been deteriorated through hardware error
or accidental overwriting, some unrelated data could be leaked.
Make sure to zero fill the buffer when this happens.
2020-08-14 11:36:57 +02:00
Erik Larsson
9893ea9ee6 Merge endianness fixes.
Conflicts:
	libntfs-3g/attrib.c
2016-01-28 09:22:42 +01:00
Erik Larsson
f076fae75a Fix endianness issues in log and terminal output.
This commit addresses issues where little-endian variables are emitted
raw to a log or output stream which is to be interpreted by the user.

Outputting data in non-native endianness can cause confusion for anybody
attempting to debug issues with a file system.
2015-12-21 23:31:09 +01:00
Jean-Pierre André
5741f54529 Zeroed uninitialized bytes before writing compressed data
Compressed records may be written as full clusters even though cluster
tails are meaningless. This is to avoid the lower levels doing a read-
modify-write cycle. Be sure to zero the meaningless bytes to avoid
leaking information.

Contributed by Eric Biggers
2015-04-17 11:31:47 +02:00
Jean-Pierre André
b6152757c5 Reengineered the compression algorithm
This patch changes the algorithm to use hash chains instead of binary
trees, with much stronger hashing.  It also introduces useful (for
performance) parameters, such as the "nice match length" and "maximum
search depth", that are similar to those used in other commonly used
compression algorithms such as zlib's DEFLATE implementation.

The speed improvement is very significant, with some loss of compression
rate. The compression rate is still better than then Windows one.

Contributed by Eric Biggers
2014-09-02 09:45:16 +02:00
Jean-Pierre André
ea8e192613 Traced dirtying runlists and updated them accordingly
Use a new flag to trace changes to a runlist and avoid recomputing the
runlist when no actual change occurred.
2014-03-11 10:11:00 +01:00
Jean-Pierre André
66cdec13d9 Fixed processing compressed data beyond file size
Windows 8 does not zero any more the end of a compression block beyond
what is needed to reach the end of a file. We must now be careful not
to decompress more data than needed.
2013-05-30 10:23:04 +02:00
Jean-Pierre André
919eeb71df Improved compression (faster) 2011-07-05 12:17:30 +02:00
Jean-Pierre André
a46a395006 Updated copyright notices 2011-02-08 13:52:12 +01:00
Jean-Pierre André
d58b21ec1d Fixed possible wrong hole size when overwriting compressed data 2011-02-08 13:52:12 +01:00
Jean-Pierre André
48caa7a45e Took care of alignments needed on some processors 2010-11-09 09:43:31 +01:00
Jean-Pierre André
400632dea5 Fixed updating compressed sizes 2010-07-22 15:00:37 +02:00
Jean-Pierre André
5533eb565f Fixed bad sanity check before compressing (was permissive) 2010-07-22 14:40:24 +02:00
Jean-Pierre André
1377f009e7 Fixed error returns when writing compressed data 2010-07-22 14:39:19 +02:00
Jean-Pierre André
a52c79b46b Fixed loops when trying to read a broken compressed file 2010-06-18 14:04:23 +02:00
Jean-Pierre André
cc4b358383 Fixed freeing a full compression block when fragmented 2010-05-28 16:33:50 +02:00
Jean-Pierre André
a192775e2a developed overwriting compressed files 2010-05-25 10:25:31 +02:00
jpandre
c468e74acd Avoided a compiler warning 2009-12-17 09:17:16 +00:00
jpandre
88473752c5 Allowed creating holes in compressed files 2009-08-11 08:02:59 +00:00
jpandre
9ce63a72d5 Fixed a data compression bug causing suboptimal compression 2009-06-17 08:07:58 +00:00
jpandre
bcc9b7dbdc Fixed cluster releases for compressed files 2009-04-25 11:52:00 +00:00
jpandre
eb282c019a Inserted a reference to lzhuf.c from which the search for matches was borrowed 2009-04-08 19:24:53 +00:00
jpandre
c86e0dbf6b Improved the loop for searching matches 2009-04-08 19:21:57 +00:00
jpandre
2fbaecd759 Extended transparent compression support to sequential writing to compressed files 2009-04-03 13:33:24 +00:00
jpandre
2a1d75a3da Adapted to ntfs-3g.2009.3.8 2009-03-27 09:10:00 +00:00
szaka
ba63b7daca initial CVS import 2006-10-30 22:32:48 +00:00