summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/evp_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/evp_test.c b/test/evp_test.c
index 311814b1bd..25b10d3314 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -863,7 +863,8 @@ static int mac_test_init(EVP_TEST *t, const char *alg)
size_t sz = strlen(alg);
static const char epilogue[] = " by EVP_PKEY";
- if (strcmp(alg + sz - (sizeof(epilogue) - 1), epilogue) == 0)
+ if (sz >= sizeof(epilogue)
+ && strcmp(alg + sz - (sizeof(epilogue) - 1), epilogue) == 0)
sz -= sizeof(epilogue) - 1;
if (strncmp(alg, "HMAC", sz) == 0) {