[glib-networking/mcatanzaro/priority-assert] gnutls: remove bogus assert
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/priority-assert] gnutls: remove bogus assert
- Date: Wed, 27 Oct 2021 13:29:32 +0000 (UTC)
commit ca87264524887b09e69bb0272b13d1964a421a5a
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]