changeset 28392:64fbf431d952

Print that specific message only when there is a CN; otherwise fall back to the error from invalidity_reason_to_string(). Fixes #10519. Thanks for pointing this out, QuLogic.
author Paul Aurich <paul@darkrain42.org>
date Fri, 16 Oct 2009 04:42:39 +0000
parents b7d60f0e1df2
children 63881771e1bf
files libpurple/certificate.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Fri Oct 16 02:39:40 2009 +0000
+++ b/libpurple/certificate.c	Fri Oct 16 04:42:39 2009 +0000
@@ -1402,13 +1402,15 @@
 		if (flags & PURPLE_CERTIFICATE_NAME_MISMATCH) {
 			gchar *sn = purple_certificate_get_subject_name(peer_crt);
 
-			g_string_append_printf(errors, _("The certificate claims to be "
-						"from \"%s\" instead. This could mean that you are "
-						"not connecting to the service you believe you are."),
-						sn ? sn : "(null)");
-			g_free(sn);
+			if (sn) {
+				g_string_append_printf(errors, _("The certificate claims to be "
+							"from \"%s\" instead. This could mean that you are "
+							"not connecting to the service you believe you are."),
+							sn);
+				g_free(sn);
 
-			flags &= ~PURPLE_CERTIFICATE_NAME_MISMATCH;
+				flags &= ~PURPLE_CERTIFICATE_NAME_MISMATCH;
+			}
 		}
 
 		while (i != PURPLE_CERTIFICATE_LAST) {