diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-07-22 02:09:04 +0200 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-07-22 13:07:13 +0200 |
commit | ee8f785873232583114981b5b44c64826b52116e (patch) | |
tree | 6f3c7c1886795b7064c02e8747f4335cba42c579 /apps/rehash.c | |
parent | use correct name for duplicate (diff) | |
download | openssl-ee8f785873232583114981b5b44c64826b52116e.tar.xz openssl-ee8f785873232583114981b5b44c64826b52116e.zip |
Check suffixes properly.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/rehash.c')
-rw-r--r-- | apps/rehash.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); |