[glib-networking/mcatanzaro/priority-assert: 8/8] gnutls: remove bogus assert
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/priority-assert: 8/8] gnutls: remove bogus assert
- Date: Tue, 9 Nov 2021 23:19:02 +0000 (UTC)
commit efdf5c7f9da5ec9a3d728dea45acb23bf82957e5
Author: Michael Catanzaro <mcatanzaro redhat com>
Date: Wed Oct 27 08:28:32 2021 -0500
gnutls: remove bogus assert
Configuring priority may fail. Asserting that it didn't fail is wrong.
We have to handle this either here or in the calling code, and here
seems easiest.
https://bugzilla.redhat.com/show_bug.cgi?id=2017422
tls/gnutls/gtlsconnection-gnutls.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index 6881cf21..2b768bf0 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -106,7 +106,13 @@ g_tls_connection_gnutls_set_handshake_priority (GTlsConnectionGnutls *gnutls)
GTlsConnectionGnutlsPrivate *priv = g_tls_connection_gnutls_get_instance_private (gnutls);
int ret;
- g_assert (priority);
+ if (!priority)
+ {
+ /* initialize_gnutls_priority() previously failed and printed a warning,
+ * so no need for further warnings here.
+ */
+ return;
+ }
ret = gnutls_priority_set (priv->session, priority);
if (ret != GNUTLS_E_SUCCESS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]