aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorLars Immisch <lars@ibp.de>2007-01-30 14:24:57 -0800
committerDavid S. Miller <davem@davemloft.net>2007-01-30 14:24:57 -0800
commit7da5bfbb12e327b3a347ee3e076957cd6564eb56 (patch)
treeea964be487ae79c645224237994628af491b19ec /net/netfilter
parentfb74a8416022c033e1a950689c264c453f8f98d8 (diff)
downloadkernel_goldelico_gta04-7da5bfbb12e327b3a347ee3e076957cd6564eb56.zip
kernel_goldelico_gta04-7da5bfbb12e327b3a347ee3e076957cd6564eb56.tar.gz
kernel_goldelico_gta04-7da5bfbb12e327b3a347ee3e076957cd6564eb56.tar.bz2
[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/netfilter')
-rw-r--r--net/netfilter/nf_conntrack_sip.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index eb2a241..c93fb37 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,
{
int s = *shift;
- for (; dptr <= limit && *dptr != '@'; dptr++)
+ /* Search for @, but stop at the end of the line.
+ * We are inside a sip: URI, so we don't need to worry about
+ * continuation lines. */
+ while (dptr <= limit &&
+ *dptr != '@' && *dptr != '\r' && *dptr != '\n') {
(*shift)++;
+ dptr++;
+ }
if (*dptr == '@') {
dptr++;