diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-04-21 20:33:38 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-04-21 20:33:38 +0000 |
commit | 0e3a1c966c9ee6263128ec6e8cc26f77a70b8c96 (patch) | |
tree | 50977243b336f7f030fc0044131f87ad0a00574e /lib | |
parent | b0d4a24dbbd87da434ff9343d52d1afe8ec147ea (diff) |
cms_io: reverse polarity of an if statement to unindent
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/cms/cms_io.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/libcrypto/cms/cms_io.c b/lib/libcrypto/cms/cms_io.c index c45e4a03dd2..d5aeea952d4 100644 --- a/lib/libcrypto/cms/cms_io.c +++ b/lib/libcrypto/cms/cms_io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cms_io.c,v 1.15 2023/04/21 20:30:53 tb Exp $ */ +/* $OpenBSD: cms_io.c,v 1.16 2023/04/21 20:33:37 tb Exp $ */ /* * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. @@ -64,19 +64,21 @@ CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms) { ASN1_OCTET_STRING **pos; - pos = CMS_get0_content(cms); - if (pos == NULL) + if ((pos = CMS_get0_content(cms)) == NULL) return 0; + if (*pos == NULL) *pos = ASN1_OCTET_STRING_new(); - if (*pos != NULL) { - (*pos)->flags |= ASN1_STRING_FLAG_NDEF; - (*pos)->flags &= ~ASN1_STRING_FLAG_CONT; - *boundary = &(*pos)->data; - return 1; + if (*pos == NULL) { + CMSerror(ERR_R_MALLOC_FAILURE); + return 0; } - CMSerror(ERR_R_MALLOC_FAILURE); - return 0; + + (*pos)->flags |= ASN1_STRING_FLAG_NDEF; + (*pos)->flags &= ~ASN1_STRING_FLAG_CONT; + *boundary = &(*pos)->data; + + return 1; } CMS_ContentInfo * |