Commit 54101f4f authored by Patrick McHardy's avatar Patrick McHardy

netfilter: nf_conntrack_sip: fix ct_sip_parse_request() REGISTER request 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: default avatarPatrick McHardy <kaber@trash.net>
parent b87921bd
...@@ -236,12 +236,13 @@ int ct_sip_parse_request(const struct nf_conn *ct, ...@@ -236,12 +236,13 @@ int ct_sip_parse_request(const struct nf_conn *ct,
return 0; return 0;
/* Find SIP URI */ /* Find SIP URI */
limit -= strlen("sip:"); for (; dptr < limit - strlen("sip:"); dptr++) {
for (; dptr < limit; dptr++) {
if (*dptr == '\r' || *dptr == '\n') if (*dptr == '\r' || *dptr == '\n')
return -1; return -1;
if (strnicmp(dptr, "sip:", strlen("sip:")) == 0) if (strnicmp(dptr, "sip:", strlen("sip:")) == 0) {
dptr += strlen("sip:");
break; break;
}
} }
if (!skp_epaddr_len(ct, dptr, limit, &shift)) if (!skp_epaddr_len(ct, dptr, limit, &shift))
return 0; return 0;
......
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