[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Mon Oct 29 18:07:13 UTC 2018


The branch master has been updated
       via  88e3cf0a1024f4afaf8e44553526eb326db102bc (commit)
      from  ce5d64c79c4d809ece8fe28a5b62915467a1c0e1 (commit)


- Log -----------------------------------------------------------------
commit 88e3cf0a1024f4afaf8e44553526eb326db102bc
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Oct 29 16:27:43 2018 +0100

    test/evp_test.c: Fixed strcmp() fault in mac_test_init()
    
    When wanting to compare the end of a string with another string, make
    sure not to start somewhere before the start of the first string.
    
    [extended tests]
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/7520)

-----------------------------------------------------------------------

Summary of changes:
 test/evp_test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/evp_test.c b/test/evp_test.c
index 311814b..25b10d3 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) {


More information about the openssl-commits mailing list