fix possible segfault in empty-string case

remotes/origin/3.3+ngcp2.6
Richard Fuchs 14 years ago
parent 2ec68d4706
commit 6132ee261b

@ -59,6 +59,7 @@ static str pv_uri_scheme[] = {
{ "urn", 3 }, { "urn", 3 },
{ 0, 0 } { 0, 0 }
}; };
static char *empty_str = "";
int _pv_pid = 0; 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)); memset(&act, 0, sizeof(act));
act.type = SET_USER_T; act.type = SET_USER_T;
act.val[0].type = STRING_ST; act.val[0].type = STRING_ST;
act.val[0].u.string = ""; act.val[0].u.string = empty_str;
init_run_actions_ctx(&h); init_run_actions_ctx(&h);
if (do_action(&h, &act, msg)<0) 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)); memset(&act, 0, sizeof(act));
act.type = SET_PORT_T; act.type = SET_PORT_T;
act.val[0].type = STRING_ST; act.val[0].type = STRING_ST;
act.val[0].u.string = ""; act.val[0].u.string = empty_str;
init_run_actions_ctx(&h); init_run_actions_ctx(&h);
if (do_action(&h, &act, msg)<0) if (do_action(&h, &act, msg)<0)
{ {

Loading…
Cancel
Save