Skip to content

Commit

Permalink
netfilter: nf_conntrack_sip: fix ct_sip_parse_request() REGISTER requ…
Browse files Browse the repository at this point in the history
…est parsing

When requests are parsed, the "sip:" part of the SIP URI should be skipped.

Usually this doesn't matter because address parsing skips forward until after
the username part, but in case REGISTER requests it doesn't contain a username
and the address can not be parsed.

Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Patrick McHardy committed Feb 11, 2010
1 parent b87921b commit 54101f4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/netfilter/nf_conntrack_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,13 @@ int ct_sip_parse_request(const struct nf_conn *ct,
return 0;

/* Find SIP URI */
limit -= strlen("sip:");
for (; dptr < limit; dptr++) {
for (; dptr < limit - strlen("sip:"); dptr++) {
if (*dptr == '\r' || *dptr == '\n')
return -1;
if (strnicmp(dptr, "sip:", strlen("sip:")) == 0)
if (strnicmp(dptr, "sip:", strlen("sip:")) == 0) {
dptr += strlen("sip:");
break;
}
}
if (!skp_epaddr_len(ct, dptr, limit, &shift))
return 0;
Expand Down

0 comments on commit 54101f4

Please sign in to comment.