Module: kamailio Branch: master Commit: b02c247023ea3ea0ef9753efdb04aff7d5d3bbb4 URL: https://github.com/kamailio/kamailio/commit/b02c247023ea3ea0ef9753efdb04aff7...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-06-09T10:53:22+02:00
app_python: check if f_code field in frame is set before using in log message
---
Modified: src/modules/app_python/apy_kemi.c
---
Diff: https://github.com/kamailio/kamailio/commit/b02c247023ea3ea0ef9753efdb04aff7... Patch: https://github.com/kamailio/kamailio/commit/b02c247023ea3ea0ef9753efdb04aff7...
---
diff --git a/src/modules/app_python/apy_kemi.c b/src/modules/app_python/apy_kemi.c index 5320b02155..43a47d28ad 100644 --- a/src/modules/app_python/apy_kemi.c +++ b/src/modules/app_python/apy_kemi.c @@ -1814,9 +1814,9 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx) " took too long [%u us] (file:%s func:%s line:%d)\n", (ket->mname.len>0)?ket->mname.s:"", (ket->mname.len>0)?".":"", ket->fname.s, tdiff, - (pframe)?PyString_AsString(pframe->f_code->co_filename):"", - (pframe)?PyString_AsString(pframe->f_code->co_name):"", - (pframe)?PyCode_Addr2Line(pframe->f_code, pframe->f_lasti):0); + (pframe && pframe->f_code)?PyString_AsString(pframe->f_code->co_filename):"", + (pframe && pframe->f_code)?PyString_AsString(pframe->f_code->co_name):"", + (pframe && pframe->f_code)?PyCode_Addr2Line(pframe->f_code, pframe->f_lasti):0); } }