From 2420189943cc348e3b4c12e7cfe70a92af395fdd Mon Sep 17 00:00:00 2001 From: tb <> Date: Thu, 5 May 2022 19:46:36 +0000 Subject: Avoid malloc(0) in EVP_PKEY_CTX_set1_hkdf_key() ok jsing --- src/lib/libcrypto/kdf/hkdf_evp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/kdf/hkdf_evp.c b/src/lib/libcrypto/kdf/hkdf_evp.c index b334c4a32d..dd79665778 100644 --- a/src/lib/libcrypto/kdf/hkdf_evp.c +++ b/src/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) -- cgit v1.2.3-55-g6feb