Re:The hijacking flaw that lurked in Intel chips is worse th...
by adkafka on Sunday May 07, 2017 @07:16PM
(#14288230)
But using strcmp could result in buffer overflow, no?
[ Parent
| on HN ]
Re:The hijacking flaw that lurked in Intel chips is worse th...
by jjnoakes on Sunday May 07, 2017 @08:19PM
(#14288446)
How so? We aren't talking about strcpy(), just strcmp(), and all the strings in question should be nul-terminated (if they aren't then mem* routines should be used and more length checks would be needed; there are also timing attacks to worry about if we're considering all the possible issues).
But normally strncmp isn't safer than strcmp. They just do different things.