From 0d105c5683b6407b439a449a7a3f3219165b88ce Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Mon, 19 Apr 2021 21:48:35 +0300 Subject: [PATCH] [mod_python] scan-build: Called C++ object pointer is null --- src/mod/languages/mod_python/hack.diff | 8 ++++++++ src/mod/languages/mod_python/mod_python_wrap.cpp | 1 + 2 files changed, 9 insertions(+) diff --git a/src/mod/languages/mod_python/hack.diff b/src/mod/languages/mod_python/hack.diff index 27bbe275e2..771be152d0 100644 --- a/src/mod/languages/mod_python/hack.diff +++ b/src/mod/languages/mod_python/hack.diff @@ -79,3 +79,11 @@ return resultobj; fail: return NULL; +@@ -10492,6 +10492,7 @@ SWIGINTERN PyObject *_wrap_Session_setSelf(PyObject *SWIGUNUSEDPARM(self), PyObj + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setSelf" "', argument " "1"" of type '" "PYTHON::Session *""'"); + } + arg1 = reinterpret_cast< PYTHON::Session * >(argp1); ++ if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "Session_setSelf" "', argument " "1"" is NULL"); + arg2 = obj1; + (arg1)->setSelf(arg2); + resultobj = SWIG_Py_Void(); diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index 227b441b59..e8db10c7c0 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -10492,6 +10492,7 @@ SWIGINTERN PyObject *_wrap_Session_setSelf(PyObject *SWIGUNUSEDPARM(self), PyObj SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setSelf" "', argument " "1"" of type '" "PYTHON::Session *""'"); } arg1 = reinterpret_cast< PYTHON::Session * >(argp1); + if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "Session_setSelf" "', argument " "1"" is NULL"); arg2 = obj1; (arg1)->setSelf(arg2); resultobj = SWIG_Py_Void();