Skip to content

Commit

Permalink
Fix: Prevent sporadic signals when loading reports.
Browse files Browse the repository at this point in the history
Now the returned error code of the functions gnutls_x509_crt_get_dn (..)
and gnutls_x509_crt_get_issuer_dn (..) is considered to prevent the
sporadic occurence of signals when loading reports.
  • Loading branch information
jhelmold authored and timopollmeier committed Jan 24, 2025
1 parent 52d0919 commit 1e5c9f5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,12 @@ get_certificate_info (const gchar* certificate, gssize certificate_len,
gchar *buffer;
gnutls_x509_crt_get_dn (gnutls_cert, NULL, &buffer_size);
buffer = g_malloc (buffer_size);
gnutls_x509_crt_get_dn (gnutls_cert, buffer, &buffer_size);

if (escape_dns)
if (gnutls_x509_crt_get_dn (gnutls_cert, buffer, &buffer_size))
{
*subject = g_strdup ("");
g_free (buffer);
}
else if (escape_dns)
{
*subject = strescape_check_utf8 (buffer, NULL);
g_free (buffer);
Expand All @@ -544,9 +547,12 @@ get_certificate_info (const gchar* certificate, gssize certificate_len,
gchar *buffer;
gnutls_x509_crt_get_issuer_dn (gnutls_cert, NULL, &buffer_size);
buffer = g_malloc (buffer_size);
gnutls_x509_crt_get_issuer_dn (gnutls_cert, buffer, &buffer_size);

if (escape_dns)
if (gnutls_x509_crt_get_issuer_dn (gnutls_cert, buffer, &buffer_size))
{
*issuer = g_strdup ("");
g_free (buffer);
}
else if (escape_dns)
{
*issuer = strescape_check_utf8 (buffer, NULL);
g_free (buffer);
Expand Down

0 comments on commit 1e5c9f5

Please sign in to comment.