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

12 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
Sewer.
cc01039003 Improved: Make fuzzing docs a tiny bit clearer. (#142) 2024-12-12 08:28:20 +01:00
dearblue
6d1ca9b612 Fixed shift direction for crc32sum() (#109)
* Fixed shift direction for crc32sum()

ref. #105
ref. commit 7a8d35b161

* Add a `.bz3` reference file to test

The `examples/shakespeare.txt.bz3` file was created by the following command

```console
% ./bzip3 -e -b 4 < examples/shakespeare.txt > examples/shakespeare.txt.bz3
```

At this time bzip3 is version 1.1.0 and running on FreeBSD 13.2 amd64.
2023-08-06 10:10:34 +02:00
Kamila Szewczyk
28f2f1d1c2 remove the example code from the repository.
considering that many issues were reported with lack of robustness of the example code, I have decided to remove it. while it was meant to initially be a demonstration of the bzip3 APIs, i do not want to turn it into a demonstration of how to use the C standard library. to guard the code against all sorts of errors (I/O, allocation) we would need to essentially triple the size of the example code for no reason in particular. one needs to check all I/O operations - fopen, fflush, fread, fwrite, fseek. you need to check malloc return values, need to check file headers, need to sync files using UNIX apis. then a handler for each case to display an error message and `exit`. as such, when the size of the "example" will grow 3 times and become just useless stuff completely irrelevant to someone who's using the library, it will stop serving its purpose.
the example code was not a part of the library, but to stop it from drawing so much attention, it has been removed.
2023-03-27 15:14:51 +02:00
Kamila Szewczyk
383094614d Update decompress-file.c 2023-03-27 13:58:21 +02:00
Kamila Szewczyk
70f81f5da6 add a clarification on purpoted "bugs" in the decompress-file utility. 2023-03-27 13:56:59 +02:00
Kamila Szewczyk
89f03970df add the program name to compress-file and decompress-file 2023-03-23 12:46:31 +01:00
Kamila Szewczyk
fe996e05e1 reformat the code, BE CRC32 table 2023-03-19 14:53:59 +01:00
Kamila Szewczyk
f2a2ba4654 Merge remote-tracking branch 'origin/master' 2022-10-25 10:34:27 +02:00
Kamila Szewczyk
6e6acf9e2f minimum length check 2022-10-25 10:34:22 +02:00
Kamila Szewczyk
6f042bdb7b update command name in fuzzing instructions. 2022-10-25 10:18:54 +02:00
Kamila Szewczyk
c07972934a High-level API (#58) 2022-10-23 12:47:18 +02:00