> If that's already on your list, feel free to beat me to it ;-)
Sure, if you will test it for me. Here's a fix for the segfault.
It seems the initial mistake was that yyerror() does not exit.
Instead one has to use YYERROR (or err() as the check above does).
I opted for YYERROR, but i don't think it makes a difference as both
are used throughout the file.
Ok?
Index: parse.y
===================================================================
RCS file: /cvs/src/sbin/iked/parse.y,v
retrieving revision 1.81
diff -u -p -u -r1.81 parse.y
--- parse.y 28 Jun 2019 13:32:44 -0000 1.81
+++ parse.y 15 Aug 2019 21:35:16 -0000
@@ -750,8 +750,10 @@ transform : AUTHXF STRING {
sizeof(struct ipsec_xf *));
if (xfs == NULL)
err(1, "transform: recallocarray");
- if ((xfs[nxfs] = parse_xf($2, 0, authxfs)) == NULL)
+ if ((xfs[nxfs] = parse_xf($2, 0, authxfs)) == NULL) {
yyerror("%s not a valid transform", $2);
+ YYERROR;
+ }
ipsec_transforms->authxf = xfs;
ipsec_transforms->nauthxf++;
}
@@ -762,8 +764,10 @@ transform : AUTHXF STRING {
sizeof(struct ipsec_xf *));
if (xfs == NULL)
err(1, "transform: recallocarray");
- if ((xfs[nxfs] = parse_xf($2, 0, encxfs)) == NULL)
+ if ((xfs[nxfs] = parse_xf($2, 0, encxfs)) == NULL) {
yyerror("%s not a valid transform", $2);
+ YYERROR;
+ }
ipsec_transforms->encxf = xfs;
ipsec_transforms->nencxf++;
}
@@ -774,8 +778,10 @@ transform : AUTHXF STRING {
sizeof(struct ipsec_xf *));
if (xfs == NULL)
err(1, "transform: recallocarray");
- if ((xfs[nxfs] = parse_xf($2, 0, prfxfs)) == NULL)
+ if ((xfs[nxfs] = parse_xf($2, 0, prfxfs)) == NULL) {
yyerror("%s not a valid transform", $2);
+ YYERROR;
+ }
ipsec_transforms->prfxf = xfs;
ipsec_transforms->nprfxf++;
}
@@ -786,8 +792,10 @@ transform : AUTHXF STRING {
sizeof(struct ipsec_xf *));
if (xfs == NULL)
err(1, "transform: recallocarray");
- if ((xfs[nxfs] = parse_xf($2, 0, groupxfs)) == NULL)
+ if ((xfs[nxfs] = parse_xf($2, 0, groupxfs)) == NULL) {
yyerror("%s not a valid transform", $2);
+ YYERROR;
+ }
ipsec_transforms->groupxf = xfs;
ipsec_transforms->ngroupxf++;
}