On Fri, Mar 20, 2015 at 02:19:05PM +0100, Otto Visser wrote: > I then made the following (ordering) change in libfdisk/src/gpt.c: > > 956a957,961 > > /* make sure header size is between 92 and sector size bytes */ > > hsz = le32_to_cpu(header->size); > > if (hsz < GPT_HEADER_MINSZ || hsz > cxt->sector_size) > > goto invalid; > > > 973,977d977 > < goto invalid; > < > < /* make sure header size is between 92 and sector size bytes */ > < hsz = le32_to_cpu(header->size); > < if (hsz < GPT_HEADER_MINSZ || hsz > cxt->sector_size) Thanks. Fixed. > Although this fixes getting the segfault, it still means that fdisk > concludes there is no GPT label, despite that the signature is clearly > there; hence I wouldn't want to call this an actual patch. Well, be able to work with broken GPT header means that we have to implement something like fsck for GPT -- analyze each field in the header and try to fix it. I'm going to add this to TODO. I don't think something like GPT fsck should be within regular GPT probing code. It's very special use-case. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html