From 6132ee261b8193046b4a1b8b26fede32cbbdc028 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 9 Jan 2013 17:44:27 +0000 Subject: [PATCH] fix possible segfault in empty-string case --- modules_k/pv/pv_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules_k/pv/pv_core.c b/modules_k/pv/pv_core.c index 370ec1a89..5fdbc1863 100644 --- a/modules_k/pv/pv_core.c +++ b/modules_k/pv/pv_core.c @@ -59,6 +59,7 @@ static str pv_uri_scheme[] = { { "urn", 3 }, { 0, 0 } }; +static char *empty_str = ""; int _pv_pid = 0; @@ -1779,7 +1780,7 @@ int pv_set_ruri_user(struct sip_msg* msg, pv_param_t *param, memset(&act, 0, sizeof(act)); act.type = SET_USER_T; act.val[0].type = STRING_ST; - act.val[0].u.string = ""; + act.val[0].u.string = empty_str; init_run_actions_ctx(&h); if (do_action(&h, &act, msg)<0) { @@ -1872,7 +1873,7 @@ int pv_set_ruri_port(struct sip_msg* msg, pv_param_t *param, memset(&act, 0, sizeof(act)); act.type = SET_PORT_T; act.val[0].type = STRING_ST; - act.val[0].u.string = ""; + act.val[0].u.string = empty_str; init_run_actions_ctx(&h); if (do_action(&h, &act, msg)<0) {