diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/cms/cms_io.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/libcrypto/cms/cms_io.c b/src/lib/libcrypto/cms/cms_io.c index c45e4a03dd..d5aeea952d 100644 --- a/src/lib/libcrypto/cms/cms_io.c +++ b/src/lib/libcrypto/cms/cms_io.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cms_io.c,v 1.15 2023/04/21 20:30:53 tb Exp $ */ | 1 | /* $OpenBSD: cms_io.c,v 1.16 2023/04/21 20:33:37 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 4 | * project. | 4 | * project. |
| @@ -64,19 +64,21 @@ CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms) | |||
| 64 | { | 64 | { |
| 65 | ASN1_OCTET_STRING **pos; | 65 | ASN1_OCTET_STRING **pos; |
| 66 | 66 | ||
| 67 | pos = CMS_get0_content(cms); | 67 | if ((pos = CMS_get0_content(cms)) == NULL) |
| 68 | if (pos == NULL) | ||
| 69 | return 0; | 68 | return 0; |
| 69 | |||
| 70 | if (*pos == NULL) | 70 | if (*pos == NULL) |
| 71 | *pos = ASN1_OCTET_STRING_new(); | 71 | *pos = ASN1_OCTET_STRING_new(); |
| 72 | if (*pos != NULL) { | 72 | if (*pos == NULL) { |
| 73 | (*pos)->flags |= ASN1_STRING_FLAG_NDEF; | 73 | CMSerror(ERR_R_MALLOC_FAILURE); |
| 74 | (*pos)->flags &= ~ASN1_STRING_FLAG_CONT; | 74 | return 0; |
| 75 | *boundary = &(*pos)->data; | ||
| 76 | return 1; | ||
| 77 | } | 75 | } |
| 78 | CMSerror(ERR_R_MALLOC_FAILURE); | 76 | |
| 79 | return 0; | 77 | (*pos)->flags |= ASN1_STRING_FLAG_NDEF; |
| 78 | (*pos)->flags &= ~ASN1_STRING_FLAG_CONT; | ||
| 79 | *boundary = &(*pos)->data; | ||
| 80 | |||
| 81 | return 1; | ||
| 80 | } | 82 | } |
| 81 | 83 | ||
| 82 | CMS_ContentInfo * | 84 | CMS_ContentInfo * |
