From: Davidlohr Bueso Date: Sun, 7 Oct 2012 14:34:01 +0000 (+0200) Subject: fdisk: fix segfault when printing gpt raw data X-Git-Tag: v2.23-rc1~604 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42c384fa98d83d473f87dafef46e07b6697ccd9f;p=thirdparty%2Futil-linux.git fdisk: fix segfault when printing gpt raw data Signed-off-by: Davidlohr Bueso --- diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c index 1295d54e77..e271ea17ce 100644 --- a/fdisks/fdisk.c +++ b/fdisks/fdisk.c @@ -1389,7 +1389,8 @@ static void print_raw(struct fdisk_context *cxt) int i; printf(_("Device: %s\n"), cxt->dev_path); - if (disklabel == SUN_LABEL || disklabel == SGI_LABEL) + if (disklabel == SUN_LABEL || disklabel == SGI_LABEL || + disklabel == GPT_LABEL) print_buffer(cxt, cxt->firstsector); else for (i = 3; i < partitions; i++) print_buffer(cxt, ptes[i].sectorbuffer);