Commit graph

98 commits

Author SHA1 Message Date
Con Kolivas 09ceb85afa Fix stdout dumping to console when there is inadequate memory to compress in ram by properly using temporary files. 2022-02-26 15:14:52 +11:00
Con Kolivas 4b3942103b Fix possible race condition between zpaq_decompress_buf() and clear_rulist() function as reported by wcventure. 2022-02-26 10:11:49 +11:00
Oded Shimon acaa8374d0 Fix & optimization for unzip_match
read_fdhist() cannot be called after write_1g() is called, in case that write() caused a switch to !TMP_OUTBUF, moving the read pointer.
read_fdhist() should only be called immediately after seekto_fdhist()

In this case, only one call to read_fdhist() was enough, before the loop, as subsuequent calls only gave repeats of the same data.
2021-07-11 11:20:04 +03:00
Con Kolivas c5e0df5cf9 Update copyright notices. 2021-02-16 14:20:06 +11:00
Con Kolivas be884d09e0 Deallocate runzip structures after all runzip chunks are complete to avoid a race in the case of a failed chunk decompressing. 2021-02-15 15:20:12 +11:00
Con Kolivas 257186a865 Fix zero sized archive decompression. 2018-05-17 15:06:31 +10:00
Con Kolivas 50cfb3b9f6 Prevent infinite loop from crafted/corrupt archive in unzip_match. 2018-05-16 19:26:15 +10:00
Con Kolivas b84c710902 Prevent infinite loop in runzip_fd with crafted/damaged archive. 2018-05-16 19:14:56 +10:00
Con Kolivas d212cc1115 Use dealloc() wrapper to minimise risk of local use after free. 2018-05-16 14:12:22 +10:00
Con Kolivas 752c91c502 Update more copyright notices 2016-06-11 09:22:34 +10:00
Con Kolivas 90f7228507 Fix ISO C warning in runzip.c 2015-03-10 20:02:27 +11:00
Con Kolivas 8551a43c73 Attempt to decompress file in ram only if we are unable to create temporary files when decompressing to stdout 2015-03-10 12:05:55 +11:00
Con Kolivas 6e31fc621e Cache the chunk bytes value to avoid setting it on each read_header call 2015-03-09 11:46:24 +11:00
Con Kolivas b48c3b2ee4 Don't delete the tmpinfile when decompressing from stdin before allowing seek to end to succeed in checking md5 2015-03-03 13:38:51 +11:00
Con Kolivas 184a8f0025 Rename lrzip.h to lrzip_core.h to cope with case insensitive filesystems not working with Lrzip.h vs lrzip.h 2012-07-07 21:39:40 +10:00
Con Kolivas cea59cd568 No need for all those backspaces on decompression progress. 2012-03-07 23:16:43 +11:00
Con Kolivas 086265c83f Update copyright notices and style to 1TBS for return codes. 2012-03-07 22:04:24 +11:00
Con Kolivas d9fb70bffc Fixes. 2011-09-16 23:06:17 +10:00
Con Kolivas a0fe1a8c8e Merge branch 'master' into liblrzip
Conflicts:
	runzip.c
	stream.h
2011-09-15 08:31:00 +10:00
Con Kolivas e1f2138060 Make sure to read to the end of all streams when closing down an rzip stream.
This would have made lrzip unable to decompress some rare archives if they ended up stream 0.
2011-09-15 08:28:30 +10:00
Con Kolivas a39b57a1e7 Add lots more debugging in maxverbose mode about where data is being written. 2011-09-15 08:26:07 +10:00
discomfitor 949c6d7a97 another semi-clusterfuck commit: *new logging macros *allow compression to and from any FILE, not just stdin/stdout *update main.c to work with the above 2011-08-17 20:59:41 +10:00
discomfitor 6dd20d735b giant clusterfuck commit: *add and use alloca/strdupa in some spots *implement return values on almost every function *free() is now a macro which also nulls the freed pointer *when in 'library mode', fatal_exit() will not be called *fatal()/failure() are now macros which add line number and file for logging *all occurrences of fatal/failure in files other than main.c are now wrapped to use a logging callback (if specified) and then return *functions now clean up resources on returning with an error 2011-08-17 20:59:40 +10:00
discomfitor cbff8faef7 move liblrzip.h contents to lrzip_private.h global variables----- 2011-08-17 20:59:40 +10:00
Con Kolivas 103d2ce11e Add sanity check for meaningless chunk_byte value on runzip. 2011-05-08 00:29:58 +10:00
Con Kolivas 915edb78a2 Remove unused variables and functions. 2011-03-23 08:16:07 +11:00
Con Kolivas f7a1c14e28 Put warning about possibly wrong password at appropriate place in stream.c
Use char to be consistent in open_stream_in.
Fail to failure() instead of fatal() should open_stream_in fail.
2011-03-23 01:13:15 +11:00
Con Kolivas 70e7866271 Include arpa/inet.h for those OSs that have endian details elsewhere. 2011-03-22 21:47:24 +11:00
Con Kolivas 2736118f82 Check for different endian.h includes and variants of le32toh. 2011-03-22 07:57:32 +11:00
Con Kolivas a30efcaa55 Portable generic byteswap for BE. 2011-03-22 00:13:29 +11:00
Con Kolivas c533b031bc Fix trivial compiler warnings. 2011-03-21 23:36:39 +11:00
Con Kolivas 8c8f5bdd48 lrz_crypt tweaks courtesy of Serge Belyshev. 2011-03-21 20:54:53 +11:00
Con Kolivas 2982cb7121 Yet yet more BE fixes. 2011-03-21 16:12:51 +11:00
Con Kolivas 19cbaaf8df Simplify read_vchars since it's always stored in little endian. 2011-03-21 13:33:45 +11:00
Con Kolivas 81bdbaf066 Yet more BE fixes. 2011-03-21 13:00:57 +11:00
Con Kolivas 77d44ce108 Disable output when it's not known. More endian fixes. 2011-03-20 22:22:54 +11:00
Con Kolivas ff5a5ed054 Use separate lrz_encrypt and lrz_decrypt wrappers to lrz_crypt. 2011-03-19 14:04:22 +11:00
Con Kolivas 0b1db75a44 Cleanups. 2011-03-19 13:53:43 +11:00
Con Kolivas 63fb1bafea Modify the file format further to make all block header information only encode the number of bytes determined in chunk_bytes instead of 8 full bytes all the time. 2011-03-18 23:18:36 +11:00
ckolivas e856d481bf Discard hash_iv entirely, using passphrase hash and centralise key generation.
Patch by Serge Belyshev.
2011-03-18 10:22:58 +11:00
Con Kolivas a3e80871c2 Add 8 bytes of random data to the start of every encrypted compressed block and use it along with 8 bytes from the stored salt to make a unique key and IV for encryption. 2011-03-18 00:06:11 +11:00
ckolivas 4bc23ee001 Centralise where all encryption/decryption is done, and whether to carry over the IV or not. 2011-03-17 14:10:58 +11:00
ckolivas ae63349e3c We do need to seek to read the MD5 correctly on very small files so support seeking to end and then seek to the md5 start. 2011-03-17 11:53:29 +11:00
Con Kolivas f61632670e Encrypt the md5 value as well to make the file unidentifiable. 2011-03-16 00:29:10 +11:00
ckolivas e26d0d1381 Clear the temporary infile where possible as well when we have falen back to it. 2011-03-15 11:27:07 +11:00
ckolivas 65a681a254 Relative offset is not required in tmp inbuf, it can be safely zeroed. 2011-03-15 11:21:26 +11:00
Con Kolivas 8a83741c32 Clear tmpinbuf between chunks. 2011-03-14 22:03:13 +11:00
Con Kolivas 3a8c0b6689 Remove seeks that aren't required and don't work on tmp input buffers.
Clean up open_stream_in.
2011-03-14 21:51:27 +11:00
Con Kolivas c832e80085 More infrastructure to read from temporary buffers on stdin decompression. 2011-03-14 21:19:57 +11:00
Con Kolivas 36e09f206e Begin massive read changes to support using temporary file for STDIN. 2011-03-14 20:22:45 +11:00