aboutsummaryrefslogtreecommitdiffstats
path: root/engines/ccgost/gost_pmeth.c
diff options
context:
space:
mode:
Diffstat (limited to 'engines/ccgost/gost_pmeth.c')
-rw-r--r--engines/ccgost/gost_pmeth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c
index 9af7b06d43aa..b6275b255889 100644
--- a/engines/ccgost/gost_pmeth.c
+++ b/engines/ccgost/gost_pmeth.c
@@ -502,7 +502,7 @@ static int pkey_gost_mac_ctrl_str(EVP_PKEY_CTX *ctx,
long keylen;
int ret;
unsigned char *keybuf = string_to_hex(value, &keylen);
- if (keylen != 32) {
+ if (!keybuf || keylen != 32) {
GOSTerr(GOST_F_PKEY_GOST_MAC_CTRL_STR,
GOST_R_INVALID_MAC_KEY_LENGTH);
OPENSSL_free(keybuf);