Skip to content

Commit 1cce527

Browse files
Fix the fuzzing tests.
1 parent 330181b commit 1cce527

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Modules/_xxtestfuzz/fuzzer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ static int fuzz_struct_unpack(const char* data, size_t size) {
133133
if (unpacked == NULL && PyErr_ExceptionMatches(PyExc_SystemError)) {
134134
PyErr_Clear();
135135
}
136+
/* Ignore any ValueError, these are triggered by non-ASCII format. */
137+
if (unpacked == NULL && PyErr_ExceptionMatches(PyExc_ValueError)) {
138+
PyErr_Clear();
139+
}
136140
/* Ignore any struct.error exceptions, these can be caused by invalid
137141
formats or incomplete buffers both of which are common. */
138142
if (unpacked == NULL && PyErr_ExceptionMatches(struct_error)) {

0 commit comments

Comments
 (0)