From: Nikos Mavrogiannopoulos Date: Fri, 16 May 2014 05:09:45 +0000 (+0200) Subject: Allow null list_size argument in gnutls_certificate_get_peers() X-Git-Tag: gnutls_3_3_3~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6c146cfd22bfa0a91b2f0219265b1598eb2a2f40;p=thirdparty%2Fgnutls.git Allow null list_size argument in gnutls_certificate_get_peers() --- diff --git a/lib/gnutls_ui.c b/lib/gnutls_ui.c index 1e99c646da..c4521a7915 100644 --- a/lib/gnutls_ui.c +++ b/lib/gnutls_ui.c @@ -472,7 +472,7 @@ const gnutls_datum_t *gnutls_certificate_get_ours(gnutls_session_t session) /** * gnutls_certificate_get_peers: * @session: is a gnutls session - * @list_size: is the length of the certificate list + * @list_size: is the length of the certificate list (may be %NULL) * * Get the peer's raw certificate (chain) as sent by the peer. These * certificates are in raw format (DER encoded for X.509). In case of @@ -499,7 +499,8 @@ const gnutls_datum_t *gnutls_certificate_get_peers(gnutls_session_t if (info == NULL) return NULL; - *list_size = info->ncerts; + if (list_size) + *list_size = info->ncerts; return info->raw_certificate_list; }