From: Dr. Stephen Henson Date: Fri, 22 Jul 2016 00:09:04 +0000 (+0100) Subject: Check suffixes properly. X-Git-Tag: OpenSSL_1_1_0-pre6~123 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=ee8f785873232583114981b5b44c64826b52116e;ds=sidebyside Check suffixes properly. Reviewed-by: Rich Salz --- diff --git a/apps/rehash.c b/apps/rehash.c index ee362b5fbd..443c15e13c 100644 --- a/apps/rehash.c +++ b/apps/rehash.c @@ -174,9 +174,11 @@ static int handle_symlink(const char *filename, const char *fullpath) } if (filename[i++] != '.') return -1; - for (type = OSSL_NELEM(suffixes) - 1; type > 0; type--) - if (strcasecmp(suffixes[type], &filename[i]) == 0) + for (type = OSSL_NELEM(suffixes) - 1; type > 0; type--) { + const char *suffix = suffixes[type]; + if (strncasecmp(suffix, &filename[i], strlen(suffix)) == 0) break; + } i += strlen(suffixes[type]); id = strtoul(&filename[i], &endptr, 10);