summaryrefslogtreecommitdiffstats
path: root/src/if_python.c
diff options
context:
space:
mode:
authorYee Cheng Chin <ychin.git@gmail.com>2023-09-20 19:59:47 +0200
committerChristian Brabandt <cb@256bit.org>2023-09-20 19:59:47 +0200
commitd606fccf6fd716bda43a8e1d11d898f438d28b82 (patch)
tree30de72950ac86aa810739d41dab22f8f3365208c /src/if_python.c
parentaa64ba1587d36de558f47519fa47c27e86c6e49a (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_python.c')
-rw-r--r--src/if_python.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/if_python.c b/src/if_python.c
index c6b14fec27..af5d6c0a81 100644
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -317,7 +317,7 @@ struct PyMethodDef { Py_ssize_t a; };
*/
static int(*dll_PyArg_Parse)(PyObject *, char *, ...);
static int(*dll_PyArg_ParseTuple)(PyObject *, char *, ...);
-static int(*dll_PyMem_Free)(void *);
+static void(*dll_PyMem_Free)(void *);
static void* (*dll_PyMem_Malloc)(size_t);
static int(*dll_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
static int(*dll_PyErr_BadArgument)(void);