fuzz: always call fuzz_setup_logging()

This commit is contained in:
Yu Watanabe
2023-11-18 02:09:04 +09:00
parent 965040d811
commit 5acea42501
5 changed files with 10 additions and 0 deletions

View File

@@ -12,6 +12,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (outside_size_range(size, 0, 100*1024))
return 0;
fuzz_setup_logging();
p = memdup(data, size);
assert_se(p);

View File

@@ -12,6 +12,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (data[SEP_LEN] != '\0')
return 0;
fuzz_setup_logging();
_cleanup_free_ char *p = memdup_suffix0(data + SEP_LEN + 1, size - SEP_LEN - 1);
assert_se(p);

View File

@@ -42,6 +42,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
const Input *i = (const Input *) data;
size_t len = size - offsetof(Input, str);
fuzz_setup_logging();
PRINTF_ONE(i->status, "%*.*s", i->field_width, (int) len, i->str);
PRINTF_ONE(i->status, "%*.*ls", i->field_width, (int) (len / sizeof(wchar_t)), (const wchar_t *) i->str);

View File

@@ -16,6 +16,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (outside_size_range(size, sizeof(size_t), 64 * 1024))
return 0;
fuzz_setup_logging();
size_t len, len2;
memcpy(&len, data, sizeof(len));
data += sizeof(len);

View File

@@ -12,6 +12,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
char *value = UINT_TO_PTR(0x12345678U);
char *endpos = UINT_TO_PTR(0x87654321U);
fuzz_setup_logging();
assert_se(str = malloc(size + 1));
memcpy(str, data, size);
str[size] = '\0';