Commit Graph

5 Commits

Author SHA1 Message Date
David Korth
563bb5f6c8 [unice68] unice68_unpack.c: depack_bytes: Check chk_dst_range(), *and* add chk_src_range().
One of the afl-fuzz tests (000003?) was failing due to the source
range being out of bounds.

Also, add assert() to the checked chk_src_range() and chk_dst_range()
functions.
2023-10-11 01:39:25 -04:00
David Korth
13363cfe69 [unice68] unice68_unpack.c, get_1_bit(): If chk_src_range() fails, return immediately.
Otherwise, attempting to dereference a5 will segfault.

This fixes all of the unice68 segfaults found with afl-fuzz so far...
at least in debug builds. Release builds are still faulting for some
reason...

TODO: Continue running afl-fuzz. I suspect I'll need to add something
similar to all uses of chk_src_range() and chk_dst_range().
2023-10-11 01:32:31 -04:00
David Korth
4e3c7abb98 [extlib] unice68: unice68_depacker(): Added explicit size parameters.
This is needed in order to prevent buffer overflows.

Found using afl-2.56b.
2020-06-20 12:49:21 -04:00
David Korth
e827229667 [unice68] Renamed config.h to config.unice68.h; added HAVE_CONFIG_H to unice68_exe.
This fixes the build of unice68.

The unice68 executable can now be built in tree for testing purposes,
but it isn't built or installed as part of the normal build.
2018-09-29 15:01:05 -04:00
David Korth
2d2c64f817 [extlib] unice68: Initial import of unice68-2.0.0.690.
This will be used to decompress Atari ST SNDH files.

Note that unice68 is GPLv3, so there's a compile-time option to
disable it.

TODO: Make it a DLL/SO instead and use dlopen().
2018-09-29 11:01:57 -04:00