summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-03-23 15:16:59 +0000
committertb <>2022-03-23 15:16:59 +0000
commit4ab9607bafc39e3112c831efcc8db6382fb735ba (patch)
treed319aae03cd180d12c2ed66c3bb1da325eeec324 /src
parent6031485b6ac1cfd8d2fe566ec0053a3941e253c8 (diff)
downloadopenbsd-4ab9607bafc39e3112c831efcc8db6382fb735ba.tar.gz
openbsd-4ab9607bafc39e3112c831efcc8db6382fb735ba.tar.bz2
openbsd-4ab9607bafc39e3112c831efcc8db6382fb735ba.zip
openssl cms: avoid NULL derefs on option parsing
Two missing initializations in the new option handling cause a segfault when -nodetach or -noindef is passed to openssl cms. ok inoguchi jsing miod
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/cms.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/usr.bin/openssl/cms.c b/src/usr.bin/openssl/cms.c
index 5b876941fb..a3004e8af3 100644
--- a/src/usr.bin/openssl/cms.c
+++ b/src/usr.bin/openssl/cms.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms.c,v 1.29 2022/01/16 07:11:49 inoguchi Exp $ */ 1/* $OpenBSD: cms.c,v 1.30 2022/03/23 15:16:59 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -769,12 +769,14 @@ static const struct option cms_options[] = {
769 .name = "nodetach", 769 .name = "nodetach",
770 .desc = "Use opaque signing", 770 .desc = "Use opaque signing",
771 .type = OPTION_VALUE_AND, 771 .type = OPTION_VALUE_AND,
772 .opt.value = &cms_config.flags,
772 .value = ~CMS_DETACHED, 773 .value = ~CMS_DETACHED,
773 }, 774 },
774 { 775 {
775 .name = "noindef", 776 .name = "noindef",
776 .desc = "Disable CMS streaming", 777 .desc = "Disable CMS streaming",
777 .type = OPTION_VALUE_AND, 778 .type = OPTION_VALUE_AND,
779 .opt.value = &cms_config.flags,
778 .value = ~CMS_STREAM, 780 .value = ~CMS_STREAM,
779 }, 781 },
780 { 782 {