]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
fix issue in gnutls_subject_alt_names_get().
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 18 Apr 2014 14:30:09 +0000 (16:30 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 18 Apr 2014 14:30:11 +0000 (16:30 +0200)
That caused a null pointer dereference when extracting names
from a certificate that contained an OtherName. Reported and
investigated by Kirill A. Shutemov.

lib/x509/x509_ext.c

index 733916f7fdb3f27e8a782f7f0a2a325ad03daa77..3ae37889a3abe30fbd6bb8163c9711b0d15c8200 100644 (file)
@@ -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;
        }