Zap local variable that shadows another local variable. Fixes a panic caused
authorkettenis <kettenis@openbsd.org>
Sat, 20 Dec 2014 13:45:15 +0000 (13:45 +0000)
committerkettenis <kettenis@openbsd.org>
Sat, 20 Dec 2014 13:45:15 +0000 (13:45 +0000)
by passing random stack garbage as the size to free(9).

From David Imhoff

sys/kern/subr_disk.c

index b32688f..57f654d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: subr_disk.c,v 1.175 2014/12/20 13:37:32 krw Exp $     */
+/*     $OpenBSD: subr_disk.c,v 1.176 2014/12/20 13:45:15 kettenis Exp $        */
 /*     $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $  */
 
 /*
@@ -650,7 +650,6 @@ readgptlabel(struct buf *bp, void (*strat)(struct buf *),
                uint32_t ghsize;
                uint32_t ghpartsize;
                uint32_t ghpartnum;
-               size_t gpsz;
 
                /* read header record */
                bp->b_blkno = DL_BLKTOSEC(lp, part_blkno) * DL_BLKSPERSEC(lp);