[glib-networking/mcatanzaro/tls1.2] Ensure gnutls_certificate_allocate_credentials() is successful
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/tls1.2] Ensure gnutls_certificate_allocate_credentials() is successful
- Date: Sun, 18 Aug 2019 22:40:09 +0000 (UTC)
commit 407c18c536eb92d67d451e9b31a4346d354c6f8c
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Aug 18 17:37:40 2019 -0500
Ensure gnutls_certificate_allocate_credentials() is successful
This should never happen, and it does never happen in my extensive
testing. But for robustness, we really should check to be sure it's not
happening.
tls/gnutls/gtlsconnection-gnutls.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index 4e883a7..c68fa0a 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -89,9 +89,11 @@ static void
g_tls_connection_gnutls_init (GTlsConnectionGnutls *gnutls)
{
GTlsConnectionGnutlsPrivate *priv = g_tls_connection_gnutls_get_instance_private (gnutls);
- gint unique_id;
+ int unique_id;
+ int ret;
- gnutls_certificate_allocate_credentials (&priv->creds);
+ ret = gnutls_certificate_allocate_credentials (&priv->creds);
+ g_assert (ret == GNUTLS_E_SUCCESS);
unique_id = g_atomic_int_add (&unique_interaction_id, 1);
priv->interaction_id = g_strdup_printf ("gtls:%d", unique_id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]