From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Subject: [PATCH] datalen variable unused in ftp helper. Date: Tue, 09 Mar 2004 19:17:49 +0100 Sender: netfilter-devel-admin@lists.netfilter.org Message-ID: <404E0A4D.3070303@eurodev.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040703010107010702080806" Return-path: To: netfilter-devel@lists.netfilter.org, Harald Welte Errors-To: netfilter-devel-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: List-Id: netfilter-devel.vger.kernel.org This is a multi-part message in MIME format. --------------040703010107010702080806 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, I found that the variable datalen in the ftp helper is sometimes used and sometimes not. Attached to this email the patch to fix this. regards, Pablo --------------040703010107010702080806 Content-Type: text/plain; name="ftp_helper-cleanup.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ftp_helper-cleanup.patch" --- linux-2.6.3/net/ipv4/netfilter/ip_conntrack_ftp.c 2004-03-09 18:49:21.000000000 +0100 +++ linux-2.6.3-old/net/ipv4/netfilter/ip_conntrack_ftp.c 2004-02-18 04:59:06.000000000 +0100 @@ -281,7 +281,7 @@ datalen = skb->len - dataoff; LOCK_BH(&ip_ftp_lock); - skb_copy_bits(skb, dataoff, ftp_buffer, datalen); + skb_copy_bits(skb, dataoff, ftp_buffer, skb->len - dataoff); old_seq_aft_nl_set = ct_ftp_info->seq_aft_nl_set[dir]; old_seq_aft_nl = ct_ftp_info->seq_aft_nl[dir]; @@ -317,7 +317,7 @@ for (i = 0; i < ARRAY_SIZE(search); i++) { if (search[i].dir != dir) continue; - found = find_pattern(ftp_buffer, datalen, + found = find_pattern(ftp_buffer, skb->len - dataoff, search[i].pattern, search[i].plen, search[i].skip, --------------040703010107010702080806--