All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: fgao@ikuai8.com
Cc: kadlec@blackhole.kfki.hu, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, gfree.wind@gmail.com
Subject: Re: [PATCH v2 1/2 nf-next] netfilter: ftp: Remove the useless dlen==0 condition check in find_pattern
Date: Wed, 7 Sep 2016 10:48:43 +0200	[thread overview]
Message-ID: <20160907084843.GA3906@salvia> (raw)
In-Reply-To: <1472727509-1025-1-git-send-email-fgao@ikuai8.com>

On Thu, Sep 01, 2016 at 06:58:29PM +0800, fgao@ikuai8.com wrote:
> From: Gao Feng <fgao@ikuai8.com>
> 
> The caller function "help" has already make sure the datalen could not be zero
> before invoke find_pattern as a parameter by the following codes
> 
>         if (dataoff >= skb->len) {
>                 pr_debug("ftp: dataoff(%u) >= skblen(%u)\n", dataoff,
>                          skb->len);
>                 return NF_ACCEPT;
>         }
>         datalen = skb->len - dataoff;
> 
> And the latter codes "ends_in_nl = (fb_ptr[datalen - 1] == '\n');" use datalen
> directly without checking if it is zero.
>
> So it is unneccessary to check it in find_pattern too.

Applied, thanks.

      reply	other threads:[~2016-09-07  8:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01 10:58 [PATCH v2 1/2 nf-next] netfilter: ftp: Remove the useless dlen==0 condition check in find_pattern fgao
2016-09-07  8:48 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160907084843.GA3906@salvia \
    --to=pablo@netfilter.org \
    --cc=coreteam@netfilter.org \
    --cc=fgao@ikuai8.com \
    --cc=gfree.wind@gmail.com \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.