Skip to content

Commit

Permalink
tracer: fix possible null dereference
Browse files Browse the repository at this point in the history
Fixes Coverity CID #199929 and #200006
  • Loading branch information
razvancrainea committed Jul 20, 2020
1 parent bceaca7 commit 0394012
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/tracer/tracer.c
Expand Up @@ -2061,7 +2061,7 @@ static void trace_msg_out(struct sip_msg* msg, str *sbuf,
su2ip_addr(&to_ip, to);
set_sock_columns( db_vals[7], db_vals[8], db_vals[9], toip_buff,
&to_ip,
(unsigned long)(send_sock->last_remote_real_port?
(unsigned long)(send_sock && send_sock->last_remote_real_port?
send_sock->last_remote_real_port:su_getport(to)),
proto);
}
Expand Down Expand Up @@ -2339,7 +2339,7 @@ static void trace_onreply_out(struct cell* t, int type, struct tmcb_params *ps)
su2ip_addr(&to_ip, &dst->to);
set_sock_columns( db_vals[7], db_vals[8], db_vals[9], toip_buff,
&to_ip,
(unsigned long)(dst->send_sock->last_remote_real_port?
(unsigned long)(dst->send_sock && dst->send_sock->last_remote_real_port?
dst->send_sock->last_remote_real_port:su_getport(&dst->to)),
dst->proto);
}
Expand Down

0 comments on commit 0394012

Please sign in to comment.