]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix: invoking x509_name_cannon improperly
authorPW Hu <jlu.hpw@foxmail.com>
Fri, 5 Nov 2021 09:16:03 +0000 (17:16 +0800)
committerPauli <pauli@openssl.org>
Tue, 9 Nov 2021 00:05:09 +0000 (10:05 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16974)

crypto/x509/x_name.c

index d5ef8e340874e4f23a0aa1d4436ced5e30f3ce66..bed2d049b43e6b1b7e97e0298a6ad3429f6be5d5 100644 (file)
@@ -219,8 +219,8 @@ static int x509_name_ex_i2d(const ASN1_VALUE **val, unsigned char **out,
         if (ret < 0)
             return ret;
         ret = x509_name_canon(a);
-        if (ret < 0)
-            return ret;
+        if (!ret)
+            return -1;
     }
     ret = a->bytes->length;
     if (out != NULL) {