Previous change to allow overriding changed the way we parsed and
stored the boot image path. The lifetime of the path was...much too
short. Heap allocate the kernel path.
Found by Mischa Peters.
ok mlarkin@
-/* $OpenBSD: parse.y,v 1.66 2023/04/28 19:46:42 dv Exp $ */
+/* $OpenBSD: parse.y,v 1.67 2023/04/28 21:22:20 dv Exp $ */
/*
* Copyright (c) 2007-2016 Reyk Floeter <reyk@openbsd.org>
YYERROR;
}
free($2);
- kernel = path;
+ kernel = malloc(sizeof(path));
+ if (kernel == NULL)
+ yyerror("malloc");
+ memcpy(kernel, &path, sizeof(path));
vmc.vmc_flags |= VMOP_CREATE_KERNEL;
}
| BOOT DEVICE bootdevice {