From: tb Date: Wed, 23 Mar 2022 15:16:59 +0000 (+0000) Subject: openssl cms: avoid NULL derefs on option parsing X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dd3b4b02c4a16f0ff7a77afc27802fea1789e6d7;p=openbsd 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 --- diff --git a/usr.bin/openssl/cms.c b/usr.bin/openssl/cms.c index 5b876941fb9..a3004e8af34 100644 --- a/usr.bin/openssl/cms.c +++ b/usr.bin/openssl/cms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cms.c,v 1.29 2022/01/16 07:11:49 inoguchi Exp $ */ +/* $OpenBSD: cms.c,v 1.30 2022/03/23 15:16:59 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -769,12 +769,14 @@ static const struct option cms_options[] = { .name = "nodetach", .desc = "Use opaque signing", .type = OPTION_VALUE_AND, + .opt.value = &cms_config.flags, .value = ~CMS_DETACHED, }, { .name = "noindef", .desc = "Disable CMS streaming", .type = OPTION_VALUE_AND, + .opt.value = &cms_config.flags, .value = ~CMS_STREAM, }, {