summaryrefslogtreecommitdiffstats
path: root/crypto/property
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-06-07 14:16:30 +0200
committerTomas Mraz <tomas@openssl.org>2022-06-10 14:08:56 +0200
commitf553cd4b40a2c797ea3c1559335115d9d080435a (patch)
treef7c69a75bf0fae5aa4b51644c3618e7708df1b34 /crypto/property
parent4650cf23c84f33354e5284fbcf56f131aa83343b (diff)
parse_unquoted: Check returned value from ossl_property_value()
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18494) (cherry picked from commit f91568eb50e847d0db2441fd9b9c5ffc8c4fe934)
Diffstat (limited to 'crypto/property')
-rw-r--r--crypto/property/property_parse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/property/property_parse.c b/crypto/property/property_parse.c
index 8ea53f0d61..d512507e6b 100644
--- a/crypto/property/property_parse.c
+++ b/crypto/property/property_parse.c
@@ -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;