Make sure we check the return value of extract_min_max()
authorMatt Caswell <matt@openssl.org>
Mon, 12 Feb 2018 17:22:17 +0000 (17:22 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 14 Feb 2018 15:32:06 +0000 (15:32 +0000)
Commit 42d7d7dd6 turned this function from returning void to
returning an int error code. This instance of calling it was
missed.

Found by Coverity.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5338)

crypto/x509v3/v3_asid.c

index 6bc4afd38cf480b292c652c4f497df5304dac480..50b8816d486d4034ae1bd6c75af448a6eb384524 100644 (file)
@@ -667,7 +667,9 @@ static int asid_contains(ASIdOrRanges *parent, ASIdOrRanges *child)
         for (;; p++) {
             if (p >= sk_ASIdOrRange_num(parent))
                 return 0;
-            extract_min_max(sk_ASIdOrRange_value(parent, p), &p_min, &p_max);
+            if (!extract_min_max(sk_ASIdOrRange_value(parent, p), &p_min,
+                                 &p_max))
+                return 0;
             if (ASN1_INTEGER_cmp(p_max, c_max) < 0)
                 continue;
             if (ASN1_INTEGER_cmp(p_min, c_min) > 0)