Skip to content

Commit 1edb9a6

Browse files
author
tb
committed
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
1 parent 6715dad commit 1edb9a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/usr.bin/openssl/cms.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 $ */
22
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
33
* project.
44
*/
@@ -769,12 +769,14 @@ static const struct option cms_options[] = {
769769
.name = "nodetach",
770770
.desc = "Use opaque signing",
771771
.type = OPTION_VALUE_AND,
772+
.opt.value = &cms_config.flags,
772773
.value = ~CMS_DETACHED,
773774
},
774775
{
775776
.name = "noindef",
776777
.desc = "Disable CMS streaming",
777778
.type = OPTION_VALUE_AND,
779+
.opt.value = &cms_config.flags,
778780
.value = ~CMS_STREAM,
779781
},
780782
{

0 commit comments

Comments
 (0)