From: Nikos Mavrogiannopoulos Date: Mon, 20 Feb 2017 17:50:40 +0000 (+0100) Subject: pkcs11: avoid calling memcpy will null options X-Git-Tag: gnutls_3_6_0~975 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee7bcb4d288eb76c8d6beae186e7e91055fbc84c;p=thirdparty%2Fgnutls.git pkcs11: avoid calling memcpy will null options Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/lib/pkcs11.c b/lib/pkcs11.c index 2473a4c753..4bd2f3f232 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -3046,7 +3046,7 @@ gnutls_pkcs11_obj_list_import_url3(gnutls_pkcs11_obj_t * p_list, const char *url, unsigned int flags) { - gnutls_pkcs11_obj_t *list1; + gnutls_pkcs11_obj_t *list1 = NULL; unsigned int n_list1, i; int ret; @@ -3064,7 +3064,7 @@ gnutls_pkcs11_obj_list_import_url3(gnutls_pkcs11_obj_t * p_list, } *n_list = n_list1; - if (p_list) + if (p_list && list1) memcpy(p_list, list1, n_list1*sizeof(p_list[0])); gnutls_free(list1);