Module: kamailio
Branch: master
Commit: 5042f309739460ad87dc9a064c43e602602da703
URL:
https://github.com/kamailio/kamailio/commit/5042f309739460ad87dc9a064c43e60…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-04-18T12:52:25+02:00
app_python: fix of buf memory allocation size for chars
---
Modified: modules/app_python/python_support.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5042f309739460ad87dc9a064c43e60…
Patch:
https://github.com/kamailio/kamailio/commit/5042f309739460ad87dc9a064c43e60…
---
diff --git a/modules/app_python/python_support.c b/modules/app_python/python_support.c
index e52c5e6..7a60214 100644
--- a/modules/app_python/python_support.c
+++ b/modules/app_python/python_support.c
@@ -79,13 +79,13 @@ void python_handle_exception(const char *fmt, ...)
}
buflen = 1;
- buf = (char *)pkg_realloc(NULL, buflen * sizeof(char *));
+ buf = (char *)pkg_realloc(NULL, buflen * sizeof(char));
if (!buf)
{
LM_ERR("python_handle_exception(): Can't allocate memory (%lu bytes),
pkg_realloc() has failed. Not enough memory.\n", (unsigned long)(buflen * sizeof(char
*)));
return;
}
- memset(buf, 0, sizeof(char *));
+ memset(buf, 0, buflen * sizeof(char));
for (i = 0; i < PySequence_Size(pResult); i++) {
line = PySequence_GetItem(pResult, i);