All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ip_conntrack_ftp segfault
@ 2005-01-03 19:22 Nicolas Bouliane
  2005-01-04 10:35 ` Pablo Neira
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Bouliane @ 2005-01-03 19:22 UTC (permalink / raw)
  To: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]


Hi,

This patch fix two bugs (when DEBUGP is defined):
o The var `data` doesn't exist, hence gcc complains.
o It segfault because we print an integer with `%s`.

Cheers! :)

-acidfu

[-- Attachment #2: ip_conntrack_ftp.c.patch --]
[-- Type: text/x-patch, Size: 558 bytes --]

--- /usr/src/old/linux-2.6.10/net/ipv4/netfilter/ip_conntrack_ftp.c	2004-12-24 16:35:59.000000000 -0500
+++ ip_conntrack_ftp.c	2005-01-03 14:09:06.000000000 -0500
@@ -347,9 +347,8 @@
 		goto out;
 	}
 
-	DEBUGP("conntrack_ftp: match `%.*s' (%u bytes at %u)\n",
-	       (int)matchlen, data + matchoff,
-	       matchlen, ntohl(th->seq) + matchoff);
+	DEBUGP("conntrack_ftp: match `%s' (%u bytes at %u)\n",
+			search[i].pattern, matchlen, ntohl(th->seq) + matchoff);
 
 	/* Allocate expectation which will be inserted */
 	exp = ip_conntrack_expect_alloc();

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ip_conntrack_ftp segfault
  2005-01-03 19:22 [PATCH] ip_conntrack_ftp segfault Nicolas Bouliane
@ 2005-01-04 10:35 ` Pablo Neira
  2005-01-04 18:45   ` Nicolas Bouliane
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira @ 2005-01-04 10:35 UTC (permalink / raw)
  To: Nicolas Bouliane; +Cc: netfilter-devel

nice catch, but read the comments below.

Nicolas Bouliane wrote:

> This patch fix two bugs (when DEBUGP is defined):
> o The var `data` doesn't exist, hence gcc complains.
> o It segfault because we print an integer with `%s`.
>
>------------------------------------------------------------------------
>
>--- /usr/src/old/linux-2.6.10/net/ipv4/netfilter/ip_conntrack_ftp.c	2004-12-24 16:35:59.000000000 -0500
>+++ ip_conntrack_ftp.c	2005-01-03 14:09:06.000000000 -0500
>  
>

this header must always look like, for example:

--- linux-2.6.10/net/ipv4/netfilter/ip_conntrack_ftp.c  2004-10-20 
10:12:06 +02:00
+++ linux-2.6.10-nicolas/net/ipv4/netfilter/ip_conntrack_ftp.c        
2005-01-02 16:09:01 +01:00

>@@ -347,9 +347,8 @@
> 		goto out;
> 	}
> 
>-	DEBUGP("conntrack_ftp: match `%.*s' (%u bytes at %u)\n",
>-	       (int)matchlen, data + matchoff,
>-	       matchlen, ntohl(th->seq) + matchoff);
>+	DEBUGP("conntrack_ftp: match `%s' (%u bytes at %u)\n",
>+			search[i].pattern, matchlen, ntohl(th->seq) + matchoff);
>  
>

Since this is a minor fix, try to modify as less things as you can. data 
doesn't exist but look for its natural replacement which is fb_ptr.

Rusty punish me yesterday to read part (11) of 
Documentation/SubmittingPatches in the kernel source tree :). So do it 
you as well and add your sign-off.

Resend a patch which fixes the things above. After that, let wait to see 
if Patrick wants to add this to his changeset 8).

--
Pablo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ip_conntrack_ftp segfault
  2005-01-04 10:35 ` Pablo Neira
@ 2005-01-04 18:45   ` Nicolas Bouliane
  2005-02-01 13:24     ` Patrick McHardy
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Bouliane @ 2005-01-04 18:45 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Pablo Neira

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

Pablo Neira wrote:
> nice catch, but read the comments below.

> Since this is a minor fix, try to modify as less things as you can. data 
> doesn't exist but look for its natural replacement which is fb_ptr.

Hey Pablo, thanks for the hints! :)

>> This patch fix two bugs (when DEBUGP is defined):
>> o The var `data` doesn't exist, hence gcc complains.
>> o It segfault because we print an integer with `%s`.

Signed-off-by: Nicolas Bouliane <nib@cookinglinux.org>



[-- Attachment #2: ip_conntrack_ftp.c.patch --]
[-- Type: text/x-patch, Size: 613 bytes --]

--- linux-2.6.10/net/ipv4/netfilter/ip_conntrack_ftp.c	2004-12-24 16:35:59.000000000 -0500
+++ linux-2.6.10NIB/net/ipv4/netfilter/ip_conntrack_ftp.c	2005-01-04 13:24:35.000000000 -0500
@@ -347,10 +347,9 @@
 		goto out;
 	}
 
-	DEBUGP("conntrack_ftp: match `%.*s' (%u bytes at %u)\n",
-	       (int)matchlen, data + matchoff,
-	       matchlen, ntohl(th->seq) + matchoff);
-
+	DEBUGP("conntrack_ftp: match `%s' (%u bytes at %u)\n",
+	       fb_ptr + matchoff, matchlen, ntohl(th->seq) + matchoff);
+			 
 	/* Allocate expectation which will be inserted */
 	exp = ip_conntrack_expect_alloc();
 	if (exp == NULL) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ip_conntrack_ftp segfault
  2005-01-04 18:45   ` Nicolas Bouliane
@ 2005-02-01 13:24     ` Patrick McHardy
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2005-02-01 13:24 UTC (permalink / raw)
  To: Nicolas Bouliane; +Cc: netfilter-devel, Pablo Neira

Nicolas Bouliane wrote:

>>> This patch fix two bugs (when DEBUGP is defined):
>>> o The var `data` doesn't exist, hence gcc complains.
>>> o It segfault because we print an integer with `%s`.
>>
>
> Signed-off-by: Nicolas Bouliane <nib@cookinglinux.org>

Applied, thanks.

Regards
Patrick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-01 13:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-03 19:22 [PATCH] ip_conntrack_ftp segfault Nicolas Bouliane
2005-01-04 10:35 ` Pablo Neira
2005-01-04 18:45   ` Nicolas Bouliane
2005-02-01 13:24     ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.