]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls_pcert_import_x509_list: only sort the lists it can sort
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 27 Nov 2014 15:28:10 +0000 (16:28 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 27 Nov 2014 15:28:10 +0000 (16:28 +0100)
lib/gnutls_pcert.c

index 0ce29898315f25ec32d7adec053b138fe2921903..580bb48bdc6aea2f3c7549ddfe12c9a448750e8f 100644 (file)
@@ -112,7 +112,7 @@ int gnutls_pcert_import_x509_list(gnutls_pcert_st * pcert,
        gnutls_x509_crt_t *s;
 
        s = crt;
-       if (flags & GNUTLS_X509_CRT_LIST_SORT && *ncrt > 1) {
+       if (flags & GNUTLS_X509_CRT_LIST_SORT && *ncrt > 1 && *ncrt < DEFAULT_MAX_VERIFY_DEPTH) {
                s = _gnutls_sort_clist(sorted, crt, ncrt, NULL);
                if (s == crt) {
                        gnutls_assert();