Skip to content

Commit

Permalink
Fix NULL pointer deref. in "acc_db_request" when "db_url" is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Feb 6, 2014
1 parent abdcbaf commit 5d61f37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/acc/acc_logic.c
Expand Up @@ -210,7 +210,7 @@ int w_acc_aaa_request(struct sip_msg *rq, pv_elem_t* comment, char* foo)
int w_acc_db_request(struct sip_msg *rq, pv_elem_t* comment, char *table)
{
struct acc_param accp;
int table_len = strlen(table);
int table_len;

if (!table) {
LM_ERR("db support not configured\n");
Expand All @@ -220,11 +220,13 @@ int w_acc_db_request(struct sip_msg *rq, pv_elem_t* comment, char *table)
if (acc_preparse_req(rq)<0)
return -1;

table_len = strlen(table);

acc_pvel_to_acc_param(rq, comment, &accp);

env_set_to( rq->to );
env_set_comment( &accp );
env_set_text(table, strlen(table));
env_set_text(table, table_len);

if (table_len == db_table_mc.len && (strncmp(table, db_table_mc.s, table_len) == 0)) {
return acc_db_request(rq, NULL, &mc_ins_list);
Expand Down

0 comments on commit 5d61f37

Please sign in to comment.