Module Name: src Committed By: martin Date: Tue Jun 25 07:14:45 UTC 2019
Modified Files: src/usr.sbin/sysinst: disklabel.c Log Message: Assert that the label data is valid before invoking disklabel(8) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/disklabel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/sysinst/disklabel.c diff -u src/usr.sbin/sysinst/disklabel.c:1.4 src/usr.sbin/sysinst/disklabel.c:1.5 --- src/usr.sbin/sysinst/disklabel.c:1.4 Thu Jun 20 18:32:32 2019 +++ src/usr.sbin/sysinst/disklabel.c Tue Jun 25 07:14:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.4 2019/06/20 18:32:32 martin Exp $ */ +/* $NetBSD: disklabel.c,v 1.5 2019/06/25 07:14:45 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -272,6 +272,8 @@ disklabel_write_to_disk(struct disk_part char *d; size_t n; + assert(parts->l.d_secsize != 0); + sprintf(fname, "/tmp/disklabel.%u", getpid()); f = fopen(fname, "w"); if (f == NULL)