libubox/tests/fuzz/corpus
Petr Štetiar 478597b9f9 blob: fix OOB access in blob_check_type
Found by fuzzer:

 ERROR: AddressSanitizer: SEGV on unknown address 0x602100000455
 The signal is caused by a READ memory access.
     #0 in blob_check_type blob.c:214:43
     #1 in blob_parse_attr blob.c:234:9
     #2 in blob_parse_untrusted blob.c:272:12
     #3 in fuzz_blob_parse tests/fuzzer/test-blob-parse-fuzzer.c:34:2
     #4 in LLVMFuzzerTestOneInput tests/fuzzer/test-blob-parse-fuzzer.c:39:2

Caused by following line:

	if (type == BLOB_ATTR_STRING && data[len - 1] != 0)

where len was pointing outside of the data buffer.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-12-25 10:31:58 +01:00
..
71520a5c4b5ca73903216857abbad54a8002d44a tests: add libFuzzer based tests 2019-12-25 10:31:58 +01:00
c1dfd96eea8cc2b62785275bca38ac261256e278 tests: add libFuzzer based tests 2019-12-25 10:31:58 +01:00
c42ac1c46f1d4e211c735cc7dfad4ff8391110e9 tests: add libFuzzer based tests 2019-12-25 10:31:58 +01:00
crash-1b8fb1be45db3aff7699100f497fb74138f3df4f test: fuzz: add blob_parse crashes 2019-12-25 10:31:58 +01:00
crash-98595faa58ba01d85ba4fd0b109cd3d490b45795 test: fuzz: add blob_parse crashes 2019-12-25 10:31:58 +01:00
crash-333757b203a44751d3535f24b05f467183a96d09 blob: fix OOB access in blob_check_type 2019-12-25 10:31:58 +01:00
crash-d0f3aa7d60a094b021f635d4edb7807c055a4ea1 test: fuzz: add blob_parse crashes 2019-12-25 10:31:58 +01:00
crash-df9d1243057b27bbad6211e5a23d1cb699028aa2 test: fuzz: add blob_parse crashes 2019-12-25 10:31:58 +01:00
valid-blobmsg.bin tests: add libFuzzer based tests 2019-12-25 10:31:58 +01:00