Skip to contentSkip to conversation

fdisk: fix segfault when printing gpt raw data

PATCH Applied Davidlohr Bueso 2 participants 2 messages Oct 7, 2012 – Oct 18, 2012 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 4/5 fdisk: fix segfault when printing gpt raw data

---
 fdisks/fdisk.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fdisks/fdisk.c +2 -1
index 612bf87..a3ac087 100644
@@ -1390,7 +1390,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);
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw
Quoted 2 lines · Davidlohr Bueso
 fdisks/fdisk.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com