]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Allow null list_size argument in gnutls_certificate_get_peers()
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 16 May 2014 05:09:45 +0000 (07:09 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 16 May 2014 22:55:23 +0000 (00:55 +0200)
lib/gnutls_ui.c

index 1e99c646daf326b9ffc4bc940d5b707d8546a538..c4521a79150431039b30717af0412587e93d8d2e 100644 (file)
@@ -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;
 }