Skip to content

Commit

Permalink
topoh: safety check to avoid crash when there is no via header
Browse files Browse the repository at this point in the history
- based on GH #952
  • Loading branch information
qmphan authored and miconda committed Jan 27, 2017
1 parent d51c710 commit 2367fb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/topoh/th_msg.c
Expand Up @@ -954,6 +954,10 @@ int th_add_hdr_cookie(sip_msg_t *msg)
struct via_param *th_get_via_cookie(sip_msg_t *msg, struct via_body *via)
{
struct via_param *p;

if (!via) {
return NULL;
}
for(p=via->param_lst; p; p=p->next)
{
if(p->name.len==th_cookie_name.len
Expand Down

0 comments on commit 2367fb5

Please sign in to comment.