From 3f6db7e15631f277beab72e9fe15772b4991dae1 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Fri, 3 Feb 2017 23:11:27 +0100 Subject: gnutls_pkcs11_obj_list_import_url4: always return an initialized pointer When returning success, but no elements, gnutls_pkcs11_obj_list_import_url4, could have returned zero number of elements with a pointer that was uninitialized. Ensure that an initialized (i.e., null in that case), pointer is always returned. Reported by Jeremy Harris. Signed-off-by: Nikos Mavrogiannopoulos --- lib/pkcs11.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pkcs11.c b/lib/pkcs11.c index 21f8bc3ddb..2473a4c753 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -3138,6 +3138,7 @@ gnutls_pkcs11_obj_list_import_url4(gnutls_pkcs11_obj_t ** p_list, if (ret < 0) { gnutls_assert(); if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { + *p_list = NULL; *n_list = 0; ret = 0; } -- cgit v1.2.1