[openssl] master update

tomas at openssl.org tomas at openssl.org
Wed Dec 1 11:33:20 UTC 2021


The branch master has been updated
       via  a632bfaa4ee3339749f7a6a07ab4d0abee4eaaef (commit)
      from  d2217c88df6e65c756013417e5ee4f470dd12470 (commit)


- Log -----------------------------------------------------------------
commit a632bfaa4ee3339749f7a6a07ab4d0abee4eaaef
Author: Tomas Mraz <tomas at openssl.org>
Date:   Tue Nov 30 11:39:52 2021 +0100

    pvkkdf: Always reset buflen after clearing the buffer
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17164)

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

Summary of changes:
 providers/implementations/kdfs/pvkkdf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/providers/implementations/kdfs/pvkkdf.c b/providers/implementations/kdfs/pvkkdf.c
index 051c625455..e953911c83 100644
--- a/providers/implementations/kdfs/pvkkdf.c
+++ b/providers/implementations/kdfs/pvkkdf.c
@@ -97,13 +97,15 @@ static int pvk_set_membuf(unsigned char **buffer, size_t *buflen,
                              const OSSL_PARAM *p)
 {
     OPENSSL_clear_free(*buffer, *buflen);
+    *buffer = NULL;
+    *buflen = 0;
+
     if (p->data_size == 0) {
         if ((*buffer = OPENSSL_malloc(1)) == NULL) {
             ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
             return 0;
         }
     } else if (p->data != NULL) {
-        *buffer = NULL;
         if (!OSSL_PARAM_get_octet_string(p, (void **)buffer, 0, buflen))
             return 0;
     }


More information about the openssl-commits mailing list