diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-03 23:41:51 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-03 23:41:51 +0100 |
commit | 0715c72c482931b962294f9388f28fbb2a707d80 (patch) | |
tree | bda8aa0fdb0ae84cdc22033e3b88301d28c81a74 | |
parent | d16ccb7ee8b890c4e9fe5a9e062c0d525c44340c (diff) | |
download | gnutls-0715c72c482931b962294f9388f28fbb2a707d80.tar.gz |
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 <nmav@redhat.com>
-rw-r--r-- | lib/pkcs11.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |