summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2006-01-20 16:11:23 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2006-01-20 16:11:23 +0000
commit2c6ae5dfa161e80aa3aaf37f645d217f8ce714bd (patch)
treed7d9f629c4041932133df5529763b34dc98d630a
parent6d3200bf8194cf4ab129d80170fc7ccc846ae24b (diff)
initialize authtype->string in case of RSA to avoid bad free()
ok reyk@ hshoexer@
-rw-r--r--sbin/ipsecctl/parse.y12
1 files changed, 9 insertions, 3 deletions
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y
index 8dd5e259787..4d898d42155 100644
--- a/sbin/ipsecctl/parse.y
+++ b/sbin/ipsecctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.49 2006/01/17 05:39:23 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.50 2006/01/20 16:11:22 naddy Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -578,8 +578,14 @@ ikemode : /* empty */ { $$ = IKE_ACTIVE; }
| ACTIVE { $$ = IKE_ACTIVE; }
;
-ikeauth : /* empty */ { $$.type = IKE_AUTH_RSA; }
- | RSA { $$.type = IKE_AUTH_RSA; }
+ikeauth : /* empty */ {
+ $$.type = IKE_AUTH_RSA;
+ $$.string = NULL;
+ }
+ | RSA {
+ $$.type = IKE_AUTH_RSA;
+ $$.string = NULL;
+ }
| PSK STRING {
$$.type = IKE_AUTH_PSK;
if (($$.string = strdup($2)) == NULL)