From 42c384fa98d83d473f87dafef46e07b6697ccd9f Mon Sep 17 00:00:00 2001 From: Davidlohr Bueso Date: Sun, 7 Oct 2012 16:34:01 +0200 Subject: fdisk: fix segfault when printing gpt raw data Signed-off-by: Davidlohr Bueso --- fdisks/fdisk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c index 1295d54e7..e271ea17c 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); -- cgit v1.2.3-55-g7522