diff options
author | Yee Cheng Chin <ychin.git@gmail.com> | 2023-09-20 19:59:47 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-09-20 19:59:47 +0200 |
commit | d606fccf6fd716bda43a8e1d11d898f438d28b82 (patch) | |
tree | 30de72950ac86aa810739d41dab22f8f3365208c /src/if_python3.c | |
parent | aa64ba1587d36de558f47519fa47c27e86c6e49a (diff) |
patch 9.0.1917: undefined behaviour with python function pointerv9.0.1917
Problem: undefined behaviour with python function pointer
Solution: correctly cast function pointers from void
Fix more undefined behaviors in if_python
Fix remaining UBSAN errors from Clang 17 in if_python in casting
function pointers.
Also fix a mistake where `PyMem_Free()` should be returning void, by the
dynamic build is mistakenly casting it as a function that returns an
int.
closes: #13128
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Diffstat (limited to 'src/if_python3.c')
-rw-r--r-- | src/if_python3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/if_python3.c b/src/if_python3.c index d2ffada0c4..e14185efb5 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -442,7 +442,7 @@ static void(*py3_PyEval_RestoreThread)(PyThreadState *); static PyThreadState*(*py3_PyEval_SaveThread)(void); static int (*py3_PyArg_Parse)(PyObject *, char *, ...); static int (*py3_PyArg_ParseTuple)(PyObject *, char *, ...); -static int (*py3_PyMem_Free)(void *); +static void (*py3_PyMem_Free)(void *); static void* (*py3_PyMem_Malloc)(size_t); static int (*py3_Py_IsInitialized)(void); static void (*py3_PyErr_Clear)(void); |