From 1b344a4847980ef667dc1989fa59ee5d3125f183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vesa=20J=C3=A4=C3=A4skel=C3=A4inen?= Date: Wed, 4 Aug 2021 16:32:43 +0300 Subject: [PATCH] pkcs11-spy: Fix C_GetFunctionList() crash with NULL argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In real world ppFunctionList=NULL case is only used by PKCS#11 test suites but no need to crash them. Signed-off-by: Vesa Jääskeläinen --- src/pkcs11/pkcs11-spy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pkcs11/pkcs11-spy.c b/src/pkcs11/pkcs11-spy.c index b17e54c7..74f58414 100644 --- a/src/pkcs11/pkcs11-spy.c +++ b/src/pkcs11/pkcs11-spy.c @@ -531,6 +531,8 @@ CK_RV C_GetFunctionList } enter("C_GetFunctionList"); + if (ppFunctionList == NULL) + return retne(CKR_ARGUMENTS_BAD); *ppFunctionList = pkcs11_spy; return retne(CKR_OK); }