Show More
@@ -31,12 +31,12 b' extern "C" int LLVMFuzzerInitialize(int ' | |||||
31 | strncpy(cpypath, pypath.c_str(), pypath.size()); |
|
31 | strncpy(cpypath, pypath.c_str(), pypath.size()); | |
32 | setenv("PYTHONPATH", cpypath, 1); |
|
32 | setenv("PYTHONPATH", cpypath, 1); | |
33 | Py_SetPythonHome(cpypath); |
|
33 | Py_SetPythonHome(cpypath); | |
|
34 | Py_InitializeEx(0); | |||
34 | return 0; |
|
35 | return 0; | |
35 | } |
|
36 | } | |
36 |
|
37 | |||
37 | int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) |
|
38 | int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) | |
38 | { |
|
39 | { | |
39 | Py_InitializeEx(0); |
|
|||
40 | initparsers(); |
|
40 | initparsers(); | |
41 | PyObject *mtext = |
|
41 | PyObject *mtext = | |
42 | PyBytes_FromStringAndSize((const char *)Data, (Py_ssize_t)Size); |
|
42 | PyBytes_FromStringAndSize((const char *)Data, (Py_ssize_t)Size); | |
@@ -69,7 +69,6 b' except Exception as e:' | |||||
69 | Py_DECREF(code); |
|
69 | Py_DECREF(code); | |
70 | Py_DECREF(locals); |
|
70 | Py_DECREF(locals); | |
71 | Py_DECREF(mtext); |
|
71 | Py_DECREF(mtext); | |
72 | Py_Finalize(); |
|
|||
73 | return 0; // Non-zero return values are reserved for future use. |
|
72 | return 0; // Non-zero return values are reserved for future use. | |
74 | } |
|
73 | } | |
75 | } |
|
74 | } |
General Comments 0
You need to be logged in to leave comments.
Login now