On Tue, Oct 04, 2016 at 04:00:50AM -0700, Claus Assmann wrote:
> On Tue, Oct 04, 2016, Dmitrij D. Czarkoff wrote:
>
> [please do not Cc me]
>
> > I shouldn't have started on sending patches at 3AM. This one should do
> > what I intended it to do. Sorry for noise.
>
> > + else if (t == NULL && sa->minsz != sa->maxsz)
> > + errx(1, "%s: parse error on line %u", filename, idx);
>
> This doesn't seem to resolve the problem that sa->rate is
> not initialized, so a simple file like this still triggers
> the error message (at least in my tests):
>
> / 500M
> swap 1G
> /usr 2G
> /home 500G
Likely, this is better.
-Otto
Index: editor.c
===================================================================
RCS file: /cvs/src/sbin/disklabel/editor.c,v
retrieving revision 1.303
diff -u -p -r1.303 editor.c
--- editor.c 2 Sep 2016 10:47:17 -0000 1.303
+++ editor.c 4 Oct 2016 11:25:36 -0000
@@ -2386,6 +2386,7 @@ parse_autotable(char *filename)
idx + 1, sizeof(*sa))) == NULL)
err(1, NULL);
sa = &(alloc_table[0].table[idx]);
+ memset(sa, 0, sizeof(*sa));
idx++;
if ((sa->mp = get_token(&buf, &len)) == NULL ||