From: Nikos Mavrogiannopoulos Date: Fri, 18 Apr 2014 14:30:09 +0000 (+0200) Subject: fix issue in gnutls_subject_alt_names_get(). X-Git-Tag: gnutls_3_3_1~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e4eeaffe474fabd724a71288b9fd5a2d7c8a286;p=thirdparty%2Fgnutls.git fix issue in gnutls_subject_alt_names_get(). That caused a null pointer dereference when extracting names from a certificate that contained an OtherName. Reported and investigated by Kirill A. Shutemov. --- diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c index 733916f7fd..3ae37889a3 100644 --- a/lib/x509/x509_ext.c +++ b/lib/x509/x509_ext.c @@ -121,7 +121,7 @@ int gnutls_subject_alt_names_get(gnutls_subject_alt_names_t sans, if (san_type) *san_type = sans->names[seq].type; - if (sans->names[seq].type == GNUTLS_SAN_OTHERNAME) { + if (othername_oid != NULL && sans->names[seq].type == GNUTLS_SAN_OTHERNAME) { othername_oid->data = sans->names[seq].othername_oid.data; othername_oid->size = sans->names[seq].othername_oid.size; }