[gcr/nielsdg/cn-can-be-null: 2/2] gcr: Fix criticals if a CN is null
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr/nielsdg/cn-can-be-null: 2/2] gcr: Fix criticals if a CN is null
- Date: Tue, 9 Aug 2022 21:39:55 +0000 (UTC)
commit b372088b7f9c71de30503a62231ea0c9a545df8c
Author: Niels De Graef <nielsdegraef gmail com>
Date: Tue Aug 9 23:02:01 2022 +0200
gcr: Fix criticals if a CN is null
Both the issuer CN and the subject CN can be NULL, so make sure we deal
with this case. This fixes a few CRITICALs when loading a certificate
that has this.
gcr/gcr-certificate.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/gcr/gcr-certificate.c b/gcr/gcr-certificate.c
index a11cf1e8..2a38efbf 100644
--- a/gcr/gcr-certificate.c
+++ b/gcr/gcr-certificate.c
@@ -1179,9 +1179,13 @@ gcr_certificate_get_interface_elements (GcrCertificate *self)
g_clear_pointer (&display, g_free);
display = gcr_certificate_get_subject_cn (self);
+ if (display == NULL)
+ display = g_strdup (_("Unknown"));
_gcr_certificate_section_new_field_take_value (section, _("Identity"), g_steal_pointer (&display));
display = gcr_certificate_get_issuer_cn (self);
+ if (display == NULL)
+ display = g_strdup (_("Unknown"));
_gcr_certificate_section_new_field_take_value (section, _("Verified by"), g_steal_pointer (&display));
datetime = gcr_certificate_get_expiry_date (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]