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
This commit is contained in:
parent
ac8f104d7b
commit
3076cbcdc0
1 changed files with 3 additions and 3 deletions
|
|
@ -1163,10 +1163,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
|
||||||
/* here we get the method pointer for callbacks */
|
/* here we get the method pointer for callbacks */
|
||||||
const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
|
const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
|
||||||
const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
|
const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
|
||||||
if (desc) {
|
if (desc)
|
||||||
desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
|
desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
|
||||||
if (!desc) return SWIG_ERROR;
|
if (!desc)
|
||||||
}
|
return SWIG_ERROR;
|
||||||
if (ty) {
|
if (ty) {
|
||||||
swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
|
swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
|
||||||
if (tc) {
|
if (tc) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue