]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: fix segfault when printing gpt raw data
authorDavidlohr Bueso <dave@gnu.org>
Sun, 7 Oct 2012 14:34:01 +0000 (16:34 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 18 Oct 2012 10:16:01 +0000 (12:16 +0200)
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
fdisks/fdisk.c

index 1295d54e7720fcfa62d3e4321663e3e22333a14b..e271ea17ceb519ef4e540a709e536f6e43859edf 100644 (file)
@@ -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);