mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
test: Don't abort fuzz test when tox_new fails.
Right now, it can't fail, but later we want the fuzzer to randomly let I/O functions fail, so we shouldn't assert tox_new succeeded.
This commit is contained in:
parent
5073882e0f
commit
60b71adbfa
|
@ -125,7 +125,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||
Tox_Err_New error_new;
|
||||
Tox *tox = tox_new(opts, &error_new);
|
||||
|
||||
assert(tox != nullptr);
|
||||
if (tox == nullptr) {
|
||||
// It might fail, because some I/O happens in tox_new, and the fuzzer
|
||||
// might do things that make that I/O fail.
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert(error_new == TOX_ERR_NEW_OK);
|
||||
|
||||
tox_options_free(opts);
|
||||
|
|
Loading…
Reference in New Issue
Block a user