1
0
mirror of https://github.com/kspalaiologos/bzip3.git synced 2026-10-23 14:48:53 +03:00

62 Commits

Author SHA1 Message Date
Sewer.
2b2c18c290 Improve Fuzzing, Enforce Sufficient Buffer Size on Decompress, Calc Memory Usage (#144)
* Added: bz3_memory_needed API.

* Added: bz3_decode_block_bound

* Renamed: bz3_decode_bound -> bz3_decode_block_bound in documentation

* Updated: libbz3.h to specify that it is a frame that is being compressed here.

* Reworked how the fuzzer script works. Can now generate its own input for easier debugging.

* Added: Multithreading to fuzz tutorial.

* Added: 010editor template for fuzzer input.

* Improved: Ignore the AFL Input/Outputs in .gitignore

* Added a note saying `afl-whatsup` is not realtime.

* Fixed: Variable name in embedded hex editor script.

* Added: Note on where to find crashing test case :3

* Added: Integration for bz3_decode_block_bound in bz3_decode_block

* Added: Guide for fuzzing with address sanitizer.

* Fixed: Wrong branch in binary template of fuzz.c

* Improved: Description in bz3_decode_block_bound

* Revert: data_size should not compare with bz3_decode_block_bound

* Removed: `bz3_decode_block_bound` API.

* Added: BZ3_ERR_DATA_SIZE_TOO_SMALL when bz3_decode_block is called with insufficient buffer.

* Implemented: Additional bounds checks in `bz3_decode_block` and `bz3_orig_size_sufficient_for_decode` API

* Adjusted: Old fuzz script now named fuzz-decompress. Enforce includes from local files, not system.

* Fixed: Bad quote usage in bz3_decode_block

* Added: Standard fuzzer inputs.

* Fixed: fuzz failures in decode_block and added a new fuzzer script for block decodes

* Added: Sanity check that the user provided a valid compressed data size to bz3_decode_block

* Changed: bz3_memory_needed -> bz3_min_memory_needed

* Added: Round Trip Fuzzer

* Fixed: Possible out of bounds read in `lzp_decode_block`. Mark exit branches as unlikely.

* Update comment

---------

Co-authored-by: Kamila Szewczyk <27734421+kspalaiologos@users.noreply.github.com>
2024-12-15 11:46:10 +01:00
Kamila Szewczyk
cc87a80c57 docstring update 2024-12-09 15:14:47 +01:00
Kamila Szewczyk
f55631be09 Clarifications requested by #128 (#129) 2024-01-14 12:48:57 +01:00
Kamila Szewczyk
b2d61e8724 C language case. 2023-10-15 15:28:15 +02:00
dearblue
0070851478 Declare with C linkage for C++ (#117) 2023-10-15 10:36:24 +02:00
Kamila Szewczyk
646212a8f5 Update common.h 2023-07-14 09:07:43 +02:00
Kamila Szewczyk
6d041f4a06 don't use reserved macro name 2023-07-02 19:02:14 +02:00
Kamila Szewczyk
1a61c68677 update source headers 2023-05-19 15:40:23 +02:00
Kamila Szewczyk
bfa5bf82b5 tentative libsais safety patches 2023-03-26 08:02:46 +02:00
Kamila Szewczyk
fe996e05e1 reformat the code, BE CRC32 table 2023-03-19 14:53:59 +01:00
alice
5dc0802d64 prefectch -> prefetch (#88) 2023-02-24 19:38:07 +01:00
Christian Clauss
8f88fe2f71 Fix typo (#83)
* Fix typo

* Fix typo
2023-01-09 21:27:41 +01:00
Kamila Szewczyk
259d865827 add a copyright note about UB patches 2022-10-25 17:18:42 +02:00
Kamila Szewczyk
c07972934a High-level API (#58) 2022-10-23 12:47:18 +02:00
Kamila Szewczyk
1f8165b30f libbz3: version call 2022-10-22 20:39:10 +02:00
Kamila Szewczyk
11df3fc3e7 more heuristics in common.h, hopefully fix #50 2022-10-04 14:28:54 +02:00
Kamila Szewczyk
6388152a2b visibility control macros 2022-10-04 11:46:31 +02:00
niXman
054fe8a31e flockfile/funlockfile for WIN32 (#52) 2022-09-11 12:12:53 +02:00
Kamila Szewczyk
07ca4fa4c2 apply suggested fix to #46 2022-09-05 09:00:45 +02:00
Kamila Szewczyk
c5bba99d1a Merge compression code to libbz3: solve #47 and #46. (#48)
* incorporate lzp & crc32 to libbz3.c

* merge rle & ac into libbz3

* libsais: make a header-only amalgamate

* hide the AC symbols

* whitespace fixes

* conservative fix for #47

Prioritise our `restrict` detection mechanism over anything autoconf has to offer, meaning that source code in common.h won't be changed, but also define plain `restrict` as fallback for the undetected case.

* PUBLIC_API clarification
2022-09-04 12:21:36 +02:00
Kamila Szewczyk
6460697837 Revert "libtool: export only symbols starting with bz3_"
This reverts commit 5565bb56e5.
2022-09-02 13:01:43 +02:00
Kamila Szewczyk
5565bb56e5 libtool: export only symbols starting with bz3_ 2022-09-02 12:48:45 +02:00
Kamila Szewczyk
7c8ea46286 getopt shim, make format 2022-09-01 13:47:22 +02:00
Kamila Szewczyk
6ce36b8aeb restrict patch 2022-08-04 10:11:04 +02:00
Kamila Szewczyk
7d2f79ee2f make format 2022-05-13 11:04:31 +02:00
Kamila Szewczyk
fc9426ea9a move the init call to decoding 2022-05-13 11:01:01 +02:00
Kamila Szewczyk
e44014a74f move the call to flush to encoding 2022-05-13 10:59:59 +02:00
Kamila Szewczyk
f6ed0ca2de change CM api to buffer-wise 2022-05-13 10:50:45 +02:00
Kamila Szewczyk
f6bda22b40 further reduce max block size 2022-05-13 09:38:52 +02:00
Kamila Szewczyk
8401749021 ansily-compliant integer (de)serialisation 2022-05-13 07:49:56 +02:00
Kamila Szewczyk
8f2ee46097 Update libbz3.h 2022-05-12 12:53:07 +02:00
Kamila Szewczyk
ccc79dff29 bigger max size margin 2022-05-12 09:55:30 +02:00
Kamila Szewczyk
df301ae82f relicense to LGPLv3 2022-05-10 13:01:00 +02:00
Kamila Szewczyk
304f5d84a5 mingw build settings 2022-05-09 17:02:25 +02:00
Kamila Szewczyk
3f309e7bac clang-format 2022-05-08 12:12:01 +02:00
Kamila Szewczyk
62ef8a3be0 a comment about the expected n value 2022-05-07 21:07:11 +02:00
Kamila Szewczyk
acc8d85b0a PUBLIC_API specifier 2022-05-07 19:53:28 +02:00
Kamila Szewczyk
104c886c58 parallel compression/decompression 2022-05-07 14:47:48 +02:00
Kamila Szewczyk
dd898824d9 drop autotools, replace ntohl and htonl. 2022-05-07 14:17:48 +02:00
Kamila Szewczyk
8523318e07 clean up RLE code 2022-05-07 12:34:50 +02:00
Kamila Szewczyk
6fd50bb186 partially clean up the rle 2022-05-07 12:26:08 +02:00
Kamila Szewczyk
9755d1a167 uniform memory access pattern 2022-05-06 20:51:35 +02:00
Kamila Szewczyk
35691387c6 more accurate compression overhead on random data 2022-05-06 19:39:39 +02:00
Kamila Szewczyk
99deeee22c autoformat 2022-05-06 17:55:29 +02:00
Kamila Szewczyk
b864506a08 -Wall -Wextra, finish one of the TODOs 2022-05-06 17:05:25 +02:00
Kamila Szewczyk
631198b28f phase out mtf 2022-05-06 16:44:55 +02:00
Kamila Szewczyk
9a2d7a0ad2 speed up the context mixer 2022-05-06 15:41:43 +02:00
Kamila Szewczyk
2a2d3b265b dynamic library, general improvements 2022-05-06 13:53:19 +02:00
Kamila Szewczyk
830ea647d5 copy over the copyright header 2022-05-06 11:41:17 +02:00
Kamila Szewczyk
4b53a027b7 better doc comments 2022-05-05 21:26:26 +02:00