The following reply was made to PR bin/187221; it has been noted by GNATS.

From: Petr Lampa <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: bin/187221: fsck_ufs -p segmentation fault with SU+J
Date: Mon, 10 Mar 2014 12:43:11 +0100

 Simple fix, fsck -p runs without sigsegv now:
 
 --- fsutil.c    2013-07-10 17:04:10.000000000 +0200
 +++ fsutil.c.my 2014-03-10 12:33:55.000000000 +0100
 @@ -414,13 +414,15 @@
         }
         if (numbufs != cnt)
                 errx(EEXIT, "panic: lost %d buffers", numbufs - cnt);
 -       for (cnt = 0; cnt < sblock.fs_ncg; cnt++) {
 -               if (cgbufs[cnt].b_un.b_cg == NULL)
 -                       continue;
 -               flush(fswritefd, &cgbufs[cnt]);
 -               free(cgbufs[cnt].b_un.b_cg);
 +       if (cgbufs) {
 +               for (cnt = 0; cnt < sblock.fs_ncg; cnt++) {
 +                       if (cgbufs[cnt].b_un.b_cg == NULL)
 +                               continue;
 +                       flush(fswritefd, &cgbufs[cnt]);
 +                       free(cgbufs[cnt].b_un.b_cg);
 +               }
 +               free(cgbufs);
         }
 -       free(cgbufs);
         pbp = pdirbp = (struct bufarea *)0;
         if (cursnapshot == 0 && sblock.fs_clean != markclean) {
                 if ((sblock.fs_clean = markclean) != 0) {
 
 Petr Lampa
 
 -- 
 Computer Centre                             E-mail: [email protected]
 Faculty of Information Technology           Web: http://www.fit.vutbr.cz/
 Brno University of Technology               Fax:  +420 54114-1270
 Bozetechova 2, 612 66 Brno, Czech Republic  Phone: +420 54114-1225
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to