parse_unquoted: Check returned value from ossl_property_value()
authorTomas Mraz <tomas@openssl.org>
Tue, 7 Jun 2022 12:16:30 +0000 (14:16 +0200)
committerTomas Mraz <tomas@openssl.org>
Fri, 10 Jun 2022 12:06:57 +0000 (14:06 +0200)
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18494)

crypto/property/property_parse.c

index 1a78c5a43634899590811b726d7b1542f15b5cb5..cdfe4777353aff3cc4a1072006265e1f7034d74a 100644 (file)
@@ -213,11 +213,10 @@ static int parse_unquoted(OSSL_LIB_CTX *ctx, const char *t[],
         return 0;
     }
     v[i] = 0;
-    if (err) {
+    if (err)
         ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
-    } else {
-        res->v.str_val = ossl_property_value(ctx, v, create);
-    }
+    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
+        err = 1;
     *t = skip_space(s);
     res->type = OSSL_PROPERTY_TYPE_STRING;
     return !err;