From 3076cbcdc0d7b07d3efcbf286e568f3663207161 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 12 Aug 2009 00:22:47 +0000 Subject: [PATCH] Fix seg fault in SWIG_Python_ConvertFunctionPtr() for invalid values git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11537 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/python/pyrun.swg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index 38632e1ab..21fddb610 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -1163,10 +1163,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) {