Commit 30b9284d authored by David S. Miller's avatar David S. Miller
parents 372b2312 e6e4d9ed
...@@ -1419,6 +1419,7 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff, ...@@ -1419,6 +1419,7 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,
const char *dptr, *end; const char *dptr, *end;
s16 diff, tdiff = 0; s16 diff, tdiff = 0;
int ret = NF_ACCEPT; int ret = NF_ACCEPT;
bool term;
typeof(nf_nat_sip_seq_adjust_hook) nf_nat_sip_seq_adjust; typeof(nf_nat_sip_seq_adjust_hook) nf_nat_sip_seq_adjust;
if (ctinfo != IP_CT_ESTABLISHED && if (ctinfo != IP_CT_ESTABLISHED &&
...@@ -1453,14 +1454,21 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff, ...@@ -1453,14 +1454,21 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,
if (dptr + matchoff == end) if (dptr + matchoff == end)
break; break;
if (end + strlen("\r\n\r\n") > dptr + datalen) term = false;
break; for (; end + strlen("\r\n\r\n") <= dptr + datalen; end++) {
if (end[0] != '\r' || end[1] != '\n' || if (end[0] == '\r' && end[1] == '\n' &&
end[2] != '\r' || end[3] != '\n') end[2] == '\r' && end[3] == '\n') {
term = true;
break;
}
}
if (!term)
break; break;
end += strlen("\r\n\r\n") + clen; end += strlen("\r\n\r\n") + clen;
msglen = origlen = end - dptr; msglen = origlen = end - dptr;
if (msglen > datalen)
return NF_DROP;
ret = process_sip_msg(skb, ct, dataoff, &dptr, &msglen); ret = process_sip_msg(skb, ct, dataoff, &dptr, &msglen);
if (ret != NF_ACCEPT) if (ret != NF_ACCEPT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment