diff options
| author | tb <> | 2022-03-13 16:25:58 +0000 |
|---|---|---|
| committer | tb <> | 2022-03-13 16:25:58 +0000 |
| commit | eb5306b751b98d33dc4833a353cd77e6e3a9d3ad (patch) | |
| tree | 0a835925a1d3846e67b7a4c880f449069cc39b1c /src | |
| parent | fa2518a98adbc41d019ee1af4e3eb7fd994861b2 (diff) | |
| download | openbsd-eb5306b751b98d33dc4833a353cd77e6e3a9d3ad.tar.gz openbsd-eb5306b751b98d33dc4833a353cd77e6e3a9d3ad.tar.bz2 openbsd-eb5306b751b98d33dc4833a353cd77e6e3a9d3ad.zip | |
Add missing error check after strdup()
From Alex Wilson
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_constraints.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_constraints.c b/src/lib/libcrypto/x509/x509_constraints.c index c7adaa4b36..6cea794560 100644 --- a/src/lib/libcrypto/x509/x509_constraints.c +++ b/src/lib/libcrypto/x509/x509_constraints.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_constraints.c,v 1.21 2022/03/03 11:29:05 tb Exp $ */ | 1 | /* $OpenBSD: x509_constraints.c,v 1.22 2022/03/13 16:25:58 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> |
| 4 | * | 4 | * |
| @@ -949,7 +949,10 @@ x509_constraints_validate(GENERAL_NAME *constraint, | |||
| 949 | case GEN_URI: | 949 | case GEN_URI: |
| 950 | if (!x509_constraints_valid_domain_constraint(bytes, len)) | 950 | if (!x509_constraints_valid_domain_constraint(bytes, len)) |
| 951 | goto err; | 951 | goto err; |
| 952 | name->name = strdup(bytes); | 952 | if ((name->name = strdup(bytes)) == NULL) { |
| 953 | *error = X509_V_ERR_OUT_OF_MEM; | ||
| 954 | return 0; | ||
| 955 | } | ||
| 953 | name->type = GEN_URI; | 956 | name->type = GEN_URI; |
| 954 | break; | 957 | break; |
| 955 | default: | 958 | default: |
