Skip to content

Commit c466657

Browse files
authored
Update fuzzer.c
1 parent ef63cca commit c466657

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Modules/_xxtestfuzz/fuzzer.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,11 @@ static int fuzz_builtin_int(const char* data, size_t size) {
5656
base = -base;
5757
}
5858

59-
PyObject* s = PyUnicode_FromStringAndSize(data, size);
59+
PyObject* s = PyUnicode_DecodeUTF8(data, size, "replace");
6060
if (s == NULL) {
61-
if (PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) {
62-
PyErr_Clear();
63-
}
6461
return 0;
6562
}
63+
6664
PyObject* l = PyLong_FromUnicodeObject(s, base);
6765
if (l == NULL && PyErr_ExceptionMatches(PyExc_ValueError)) {
6866
PyErr_Clear();

0 commit comments

Comments
 (0)