# HG changeset patch # User William Ehlhardt # Date 1187579730 0 # Node ID e147c3a821dd6aa2ab3f906a16b8bdc77d5e56c4 # Parent 447470c8111ab7b2fbb8d7fc2c2e17131af87707 - Errorchecking in x509_cert_dn diff -r 447470c8111a -r e147c3a821dd libpurple/plugins/ssl/ssl-gnutls.c --- a/libpurple/plugins/ssl/ssl-gnutls.c Mon Aug 20 03:10:21 2007 +0000 +++ b/libpurple/plugins/ssl/ssl-gnutls.c Mon Aug 20 03:15:30 2007 +0000 @@ -766,8 +766,6 @@ cert_dat = X509_GET_GNUTLS_DATA(crt); - /* TODO: Note return values? */ - /* Figure out the length of the Distinguished Name */ /* Claim that the buffer is size 0 so GnuTLS just tells us how much space it needs */ @@ -776,7 +774,12 @@ /* Now allocate and get the Distinguished Name */ dn = g_new0(gchar, dn_size); - gnutls_x509_crt_get_dn(cert_dat, dn, &dn_size); + if (0 != gnutls_x509_crt_get_dn(cert_dat, dn, &dn_size)) { + purple_debug_error("gnutls/x509", + "Failed to get Distinguished Name\n"); + g_free(dn); + return NULL; + } return dn; }