Skip to content
Permalink
Browse files

topoh: detect when via param is shorter than expected prefix

  • Loading branch information...
miconda committed Mar 2, 2019
1 parent cbadbca commit e6950ffb1985493e717e3d774eddad779aed1514
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/modules/topoh/th_msg.c
@@ -418,12 +418,17 @@ int th_unmask_via(sip_msg_t *msg, str *cookie)
LM_ERR("cannot find param in via %d\n", i);
return -1;
}
if(i==2)
if(vp->value.len <= th_vparam_prefix.len) {
LM_ERR("invalid param len in via %d\n", i);
return -1;
}
if(i==2) {
out.s = th_mask_decode(vp->value.s, vp->value.len,
&th_vparam_prefix, CRLF_LEN+1, &out.len);
else
} else {
out.s = th_mask_decode(vp->value.s, vp->value.len,
&th_vparam_prefix, 0, &out.len);
}
if(out.s==NULL || out.len<=0)
{
LM_ERR("cannot decode via %d\n", i);

0 comments on commit e6950ff

Please sign in to comment.
You can’t perform that action at this time.