Skip to content

Commit

Permalink
netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
Browse files Browse the repository at this point in the history
Verify that the message length of a single SIP message, which is calculated
based on the Content-Length field contained in the SIP message, does not
exceed the packet boundaries.

Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
kaber committed May 16, 2011
1 parent 74973f6 commit 274ea0e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/netfilter/nf_conntrack_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,8 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,
end += strlen("\r\n\r\n") + clen;

msglen = origlen = end - dptr;
if (msglen > datalen)
return NF_DROP;

ret = process_sip_msg(skb, ct, dataoff, &dptr, &msglen);
if (ret != NF_ACCEPT)
Expand Down

0 comments on commit 274ea0e

Please sign in to comment.