Module: kamailio
Branch: master
Commit: 6e2f4d7d249f155ce43cfd6c58a8707deac175e0
URL:
https://github.com/kamailio/kamailio/commit/6e2f4d7d249f155ce43cfd6c58a8707…
Author: Stefan Mititelu <stefan.mititelu(a)1and1.ro>
Committer: Stefan Mititelu <stefan.mititelu(a)1and1.ro>
Date: 2015-09-11T10:39:33+03:00
rtpengine: fix segfault when bad mi params
Default root pointer to NULL in order to avoid segfaults due to bad mi params
(e.g string instead of int). The segfaults happened because in the above cases,
free_mi_tree(root) tries to free a random, invalid address.
---
Modified: modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6e2f4d7d249f155ce43cfd6c58a8707…
Patch:
https://github.com/kamailio/kamailio/commit/6e2f4d7d249f155ce43cfd6c58a8707…
---
diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c
index c67ac5a..3dbd0cf 100644
--- a/modules/rtpengine/rtpengine.c
+++ b/modules/rtpengine/rtpengine.c
@@ -854,7 +854,7 @@ static struct mi_root* mi_enable_rtp_proxy(struct mi_root *cmd_tree,
struct mi_node *node, *crt_node;
struct rtpp_set *rtpp_list;
struct rtpp_node *crt_rtpp, *found_rtpp;
- struct mi_root *root;
+ struct mi_root *root = NULL;
struct mi_attr *attr;
unsigned int enable;
int found, found_rtpp_disabled;
@@ -1099,7 +1099,7 @@ static struct mi_root* mi_show_rtp_proxy(struct mi_root* cmd_tree,
void* param)
{
struct mi_node *node;
- struct mi_root *root;
+ struct mi_root *root = NULL;
struct rtpp_set *rtpp_list;
struct rtpp_node *crt_rtpp;
int found;
@@ -1190,7 +1190,7 @@ static struct mi_root* mi_ping_rtp_proxy(struct mi_root* cmd_tree,
{
struct mi_node *node, *crt_node;
struct mi_attr *attr;
- struct mi_root *root;
+ struct mi_root *root = NULL;
struct rtpp_set *rtpp_list;
struct rtpp_node *crt_rtpp, *found_rtpp;
int found, found_rtpp_disabled;