]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Don't use alloca, the certificate list can be larger than stack size.
authorSimon Josefsson <simon@josefsson.org>
Thu, 17 Apr 2008 09:33:25 +0000 (11:33 +0200)
committerSimon Josefsson <simon@josefsson.org>
Thu, 17 Apr 2008 09:33:25 +0000 (11:33 +0200)
lib/auth_cert.c

index cfa80cefb8023332a5281cc6387798268e26a497..91567cb25aed344fc1caabaea2eee279129a258f 100644 (file)
@@ -1180,7 +1180,7 @@ _gnutls_proc_openpgp_server_certificate (gnutls_session_t session,
     }
 
   peer_certificate_list =
-    gnutls_alloca (sizeof (gnutls_cert) * (peer_certificate_list_size));
+    gnutls_malloc (sizeof (gnutls_cert) * (peer_certificate_list_size));
   if (peer_certificate_list == NULL)
     {
       gnutls_assert ();
@@ -1221,7 +1221,7 @@ cleanup:
 
   _gnutls_free_datum (&akey);
   CLEAR_CERTS;
-  gnutls_afree (peer_certificate_list);
+  gnutls_free (peer_certificate_list);
   return ret;
 
 }