Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7da5bfbb12e327b3a347ee3e076957cd6564eb56
Commit:     7da5bfbb12e327b3a347ee3e076957cd6564eb56
Parent:     fb74a8416022c033e1a950689c264c453f8f98d8
Author:     Lars Immisch <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 30 14:24:57 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Jan 30 14:24:57 2007 -0800

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/netfilter/ip_conntrack_sip.c |    8 +++++++-
 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 3a26d63..571d27e 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)
 {
        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++;
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++;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to