From 0715c72c482931b962294f9388f28fbb2a707d80 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Fri, 3 Feb 2017 23:41:51 +0100 Subject: gnutls_pkcs11_obj_list_import_url2: 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 d99dedff62..f5cf99d658 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -3019,6 +3019,7 @@ gnutls_pkcs11_obj_list_import_url2(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