From 817ef69ffb1724e97e5c65800f32c296a7f6d41a Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 20 Apr 2015 13:16:01 +0200 Subject: [PATCH] ggatel: In g_gatel_create(), don't pass stack garbage to the kernel Unbreaks ggatel on i386 after r238119 which added two more 'struct g_gate_ctl_create' fields. Obtained from: ElectroBSD --- sbin/ggate/ggatel/ggatel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/ggate/ggatel/ggatel.c b/sbin/ggate/ggatel/ggatel.c index e9c6e88..864f3ae 100644 --- a/sbin/ggate/ggatel/ggatel.c +++ b/sbin/ggate/ggatel/ggatel.c @@ -220,6 +220,7 @@ g_gatel_create(void) fd = open(path, g_gate_openflags(flags) | O_DIRECT | O_FSYNC); if (fd == -1) err(EXIT_FAILURE, "Cannot open %s", path); + memset(&ggioc, 0, sizeof(ggioc)); ggioc.gctl_version = G_GATE_VERSION; ggioc.gctl_unit = unit; ggioc.gctl_mediasize = g_gate_mediasize(fd); -- 2.3.0