From: David Howells <dhowells@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: dhowells@redhat.com, colin.king@canonical.com,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dns: remove redundant zero length namelen check
Date: Fri, 12 Apr 2019 11:19:51 +0100 [thread overview]
Message-ID: <17756.1555064391@warthog.procyon.org.uk> (raw)
In-Reply-To: <20190411.140203.1367510571263899902.davem@davemloft.net>
David Miller <davem@davemloft.net> wrote:
> > The zero namelen check is redundant as it has already been checked
> > for zero at the start of the function. Remove the redundant check.
> >
> > Addresses-Coverity: ("Logically Dead Code")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> Applied to net-next.
>
> However it does look like two sets of semantics were considered.
> In one case rejecting a zero namelen and in another having it
> mean whatever the strings length is modulo the max of 256.
It probably makes sense to merge the:
if (namelen < 3 || namelen > 255)
return -EINVAL;
check into the earlier:
if (!name || namelen == 0)
return -EINVAL;
check too.
David
prev parent reply other threads:[~2019-04-12 10:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-09 12:59 Colin King
2019-04-11 21:02 ` David Miller
2019-04-12 10:19 ` David Howells [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=17756.1555064391@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=colin.king@canonical.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®