From d4a5808b5e5e31596c6bb0129a55da837d635f49 Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 5 May 2022 19:46:36 +0000 Subject: [PATCH] Avoid malloc(0) in EVP_PKEY_CTX_set1_hkdf_key() ok jsing --- lib/libcrypto/kdf/hkdf_evp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/kdf/hkdf_evp.c b/lib/libcrypto/kdf/hkdf_evp.c index b334c4a32dc..dd796657786 100644 --- a/lib/libcrypto/kdf/hkdf_evp.c +++ b/lib/libcrypto/kdf/hkdf_evp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hkdf_evp.c,v 1.16 2022/05/05 19:44:23 tb Exp $ */ +/* $OpenBSD: hkdf_evp.c,v 1.17 2022/05/05 19:46:36 tb Exp $ */ /* ==================================================================== * Copyright (c) 2016-2018 The OpenSSL Project. All rights reserved. * @@ -132,7 +132,7 @@ pkey_hkdf_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) return 1; case EVP_PKEY_CTRL_HKDF_KEY: - if (p1 < 0) + if (p1 <= 0) return 0; if (kctx->key != NULL) -- 2.20.1