diff options
author | Lars Immisch <lars@ibp.de> | 2007-01-30 17:24:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-01-30 17:24:57 -0500 |
commit | 7da5bfbb12e327b3a347ee3e076957cd6564eb56 (patch) | |
tree | ea964be487ae79c645224237994628af491b19ec /net | |
parent | fb74a8416022c033e1a950689c264c453f8f98d8 (diff) |
[NETFILTER]: SIP conntrack: fix skipping over user info in SIP headers
When trying to skip over the username in the Contact header, stop at the
end of the line if no @ is found to avoid mangling following headers.
We don't need to worry about continuation lines because we search inside
a SIP URI.
Fixes Netfilter Bugzilla #532.
Signed-off-by: Lars Immisch <lars@ibp.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_sip.c | 8 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_sip.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_sip.c b/net/ipv4/netfilter/ip_conntrack_sip.c index 3a26d63eed8..571d27e2091 100644 --- a/net/ipv4/netfilter/ip_conntrack_sip.c +++ b/net/ipv4/netfilter/ip_conntrack_sip.c | |||
@@ -283,8 +283,14 @@ static int skp_epaddr_len(const char *dptr, const char *limit, int *shift) | |||
283 | { | 283 | { |
284 | int s = *shift; | 284 | int s = *shift; |
285 | 285 | ||
286 | for (; dptr <= limit && *dptr != '@'; dptr++) | 286 | /* Search for @, but stop at the end of the line. |
287 | * We are inside a sip: URI, so we don't need to worry about | ||
288 | * continuation lines. */ | ||
289 | while (dptr <= limit && | ||
290 | *dptr != '@' && *dptr != '\r' && *dptr != '\n') { | ||
287 | (*shift)++; | 291 | (*shift)++; |
292 | dptr++; | ||
293 | } | ||
288 | 294 | ||
289 | if (*dptr == '@') { | 295 | if (*dptr == '@') { |
290 | dptr++; | 296 | dptr++; |
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index eb2a2411f97..c93fb37a54f 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c | |||
@@ -303,8 +303,14 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr, | |||
303 | { | 303 | { |
304 | int s = *shift; | 304 | int s = *shift; |
305 | 305 | ||
306 | for (; dptr <= limit && *dptr != '@'; dptr++) | 306 | /* Search for @, but stop at the end of the line. |
307 | * We are inside a sip: URI, so we don't need to worry about | ||
308 | * continuation lines. */ | ||
309 | while (dptr <= limit && | ||
310 | *dptr != '@' && *dptr != '\r' && *dptr != '\n') { | ||
307 | (*shift)++; | 311 | (*shift)++; |
312 | dptr++; | ||
313 | } | ||
308 | 314 | ||
309 | if (*dptr == '@') { | 315 | if (*dptr == '@') { |
310 | dptr++; | 316 | dptr++; |