Subject: Re: [PATCH] netns: more input validation

From: Matteo Croce <[email-masked]>
Date: Tue, 25 Jul 2017 16:08:54 +0200

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.