[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1500991734.2615.1.camel@redhat.com>
Date: Tue, 25 Jul 2017 16:08:54 +0200
From: Matteo Croce <mcroce@...hat.com>
To: David Laight <David.Laight@...LAB.COM>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH] netns: more input validation
Il giorno mar, 25/07/2017 alle 13.47 +0000, David Laight ha scritto:
> Think I'd check:
> !name[0] || !memchr(name, 0, NAME_MAX) || strchr(name, '/') ||
> (name[0] == '.' && (!name[1] || (name[1] == '.' &&
> !name[2])))
>
> David
Nice optimization, but as strchr() and strcmp() are builtin functions,
at least in GCC, I don't know if there is any real advantage.
Powered by blists - more mailing lists