Index: head/sbin/geom/class/cache/geom_cache.c =================================================================== --- head/sbin/geom/class/cache/geom_cache.c +++ head/sbin/geom/class/cache/geom_cache.c @@ -137,6 +137,7 @@ int error, nargs; intmax_t val; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs != 2) { gctl_error(req, "Invalid number of arguments."); Index: head/sbin/geom/class/concat/geom_concat.c =================================================================== --- head/sbin/geom/class/concat/geom_concat.c +++ head/sbin/geom/class/concat/geom_concat.c @@ -119,6 +119,7 @@ const char *name; int error, i, hardcode, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 2) { gctl_error(req, "Too few arguments."); Index: head/sbin/geom/class/journal/geom_journal.c =================================================================== --- head/sbin/geom/class/journal/geom_journal.c +++ head/sbin/geom/class/journal/geom_journal.c @@ -144,6 +144,7 @@ intmax_t jsize, msize, ssize; int error, force, i, nargs, checksum, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); str = NULL; /* gcc */ Index: head/sbin/geom/class/label/geom_label.c =================================================================== --- head/sbin/geom/class/label/geom_label.c +++ head/sbin/geom/class/label/geom_label.c @@ -125,6 +125,7 @@ u_char sector[512]; int error, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs != 2) { gctl_error(req, "Invalid number of arguments."); @@ -145,6 +146,7 @@ strlcpy(md.md_magic, G_LABEL_MAGIC, sizeof(md.md_magic)); md.md_version = G_LABEL_VERSION; label = gctl_get_ascii(req, "arg0"); + bzero(md.md_label, sizeof(md.md_label)); strlcpy(md.md_label, label, sizeof(md.md_label)); md.md_provsize = g_get_mediasize(name); if (md.md_provsize == 0) { Index: head/sbin/geom/class/mirror/geom_mirror.c =================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c +++ head/sbin/geom/class/mirror/geom_mirror.c @@ -188,6 +188,7 @@ intmax_t val; int error, i, nargs, bal, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 2) { gctl_error(req, "Too few arguments."); Index: head/sbin/geom/class/raid3/geom_raid3.c =================================================================== --- head/sbin/geom/class/raid3/geom_raid3.c +++ head/sbin/geom/class/raid3/geom_raid3.c @@ -151,6 +151,7 @@ int hardcode, round_robin, verify; int error, i, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 4) { gctl_error(req, "Too few arguments."); Index: head/sbin/geom/class/shsec/geom_shsec.c =================================================================== --- head/sbin/geom/class/shsec/geom_shsec.c +++ head/sbin/geom/class/shsec/geom_shsec.c @@ -112,6 +112,7 @@ const char *name; int error, i, nargs, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs <= 2) { gctl_error(req, "Too few arguments."); Index: head/sbin/geom/class/stripe/geom_stripe.c =================================================================== --- head/sbin/geom/class/stripe/geom_stripe.c +++ head/sbin/geom/class/stripe/geom_stripe.c @@ -130,6 +130,7 @@ const char *name; int error, i, nargs, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 3) { gctl_error(req, "Too few arguments."); Index: head/sbin/geom/misc/subr.c =================================================================== --- head/sbin/geom/misc/subr.c +++ head/sbin/geom/misc/subr.c @@ -273,6 +273,13 @@ return (error); } +/* + * Actually write the GEOM label to the provider + * + * @param name GEOM provider's name (ie "ada0") + * @param md Pointer to the label data to write + * @param size Size of the data pointed to by md + */ int g_metadata_store(const char *name, const unsigned char *md, size_t size) { Index: head/sys/geom/virstor/g_virstor.c =================================================================== --- head/sys/geom/virstor/g_virstor.c +++ head/sys/geom/virstor/g_virstor.c @@ -1042,6 +1042,7 @@ pp = cp->provider; buf = malloc(pp->sectorsize, M_GVIRSTOR, M_WAITOK); + bzero(buf, pp->sectorsize); virstor_metadata_encode(md, buf); g_topology_unlock(); error = g_write_data(cp, pp->mediasize - pp->sectorsize, buf,