LKML Archive on
help / color / mirror / Atom feed
From: Walter Harms <>
To: Dan Carpenter <>
Cc: "Tigran A. Aivazian" <>,
	"" <>,
Subject: AW: [PATCH] bfs: prevent underflow in bfs_find_entry()
Date: Tue, 10 Mar 2020 17:57:18 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20200310090644.GA11583@kadam>

Von: Dan Carpenter <>
Gesendet: Dienstag, 10. März 2020 10:06
An: Walter Harms
Cc: Tigran A. Aivazian;;
Betreff: Re: [PATCH] bfs: prevent underflow in bfs_find_entry()

On Mon, Mar 09, 2020 at 08:40:28AM +0000, Walter Harms wrote:
> hi Dan,
> the namelen usage is fishy. It goes into bfs_namecmp()
> where it is checked for namelen < BFS_NAMELEN, leaving
> only the case ==.

The rule in bfs_namecmp() is that the name has to be NUL terminated if
there is enough space.

that raises the question why is there a len paramter in the first place.
Surely the writer can make sure that there is always a NUL terminated
string, then it would be possible the use a simple strcmp() and the
range check is useless and can be removed.

seems a question for the maintainer.


  reply	other threads:[~2020-03-10 17:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-07  6:08 Dan Carpenter
2020-03-09  8:40 ` AW: " Walter Harms
2020-03-10  9:06   ` Dan Carpenter
2020-03-10 17:57     ` Walter Harms [this message]
2020-03-10 18:22       ` Tigran Aivazian
2020-03-09  9:14 ` Tigran Aivazian
2020-03-10  8:38   ` Dan Carpenter

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:

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

  git send-email \ \ \ \ \ \ \
    --subject='Re: AW: [PATCH] bfs: prevent underflow in bfs_find_entry()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).