Have different exit codes for errors vs exceptions

This commit is contained in:
Nigel Tao committed 2020-02-23 17:05:49 +11:00
1 parent b1af7b9b41
commit 9cc2c25f3d
3 files changed
+61 -17

No files matched your search

+8 -3
View File
@@ -56,9 +56,14 @@ static const char* llvmFuzzerTestOneInput(const uint8_t* data, size_t size) {
});
const char* msg = fuzz(&src, hash);
if (msg && strstr(msg, "internal error:")) {
fprintf(stderr, "internal errors shouldn't occur: \"%s\"\n", msg);
intentional_segfault();
if (msg) {
if (strnlen(msg, 2047) >= 2047) {
msg = "fuzzlib: internal error: error message is too long";
}
if (strstr(msg, "internal error:")) {
fprintf(stderr, "internal errors shouldn't occur: \"%s\"\n", msg);
intentional_segfault();
}
}
return msg;
}