From: Michael Jerris Date: Fri, 16 May 2014 18:15:34 +0000 (+0000) Subject: CID:1025850 Dereference before null check X-Git-Tag: v1.4.4~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecde4317305cb0e8223fb19b860a63a15b8572eb;p=thirdparty%2Ffreeswitch.git CID:1025850 Dereference before null check --- diff --git a/src/mod/applications/mod_cidlookup/mod_cidlookup.c b/src/mod/applications/mod_cidlookup/mod_cidlookup.c index 72a1c99b77..2fab96ccb2 100644 --- a/src/mod/applications/mod_cidlookup/mod_cidlookup.c +++ b/src/mod/applications/mod_cidlookup/mod_cidlookup.c @@ -685,14 +685,14 @@ SWITCH_STANDARD_APP(cidlookup_app_function) cid = do_lookup(pool, event, number, skipurl, skipcitystate); } - if (switch_string_var_check_const(cid->name)) { - switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_CRIT, "Invalid CID data {%s} contains a variable\n", cid->name); - goto done; - } - if (cid && channel) { switch_event_t *event; + if (switch_string_var_check_const(cid->name)) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_CRIT, "Invalid CID data {%s} contains a variable\n", cid->name); + goto done; + } + switch_channel_set_variable(channel, "original_caller_id_name", switch_core_strdup(pool, profile->caller_id_name)); if (!zstr(cid->src)) { switch_channel_set_variable(channel, "cidlookup_source", cid->src);