OSDN Git Service

gpt: don't malfunction on big-endian systems
authorJim Meyering <meyering@redhat.com>
Tue, 6 Oct 2009 18:10:00 +0000 (20:10 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 6 Oct 2009 18:28:54 +0000 (20:28 +0200)
commitd6e9b3bbda5eb565b6031b5620e38cba871c6748
treea1491c6483665b7e207d8eaa691ad1b89d13d843
parent1baf336173f209d2d23b29269e0a12b4522f7257
gpt: don't malfunction on big-endian systems

Numerous GPT tests would fail when run on e.g., big-endian PPC.
* libparted/labels/gpt.c (gpt_read): Now that we use the
SizeOfPartitionEntry member, be sure to convert from GPT's
little-endian on-disk format to to CPU endianness.
This bug was introduced via commit 14cce9b2, 2009-06-10, "gpt:
fix gpt_read to read all of the partition entries correctly".
* libparted/labels/gpt.c (_header_is_valid): Also convert it here.
Add a test to ensure that the partition entry size is no larger
than the slightly arbitrary UINT32_MAX/16.
* NEWS (Bug fixes): Mention it.
NEWS
libparted/labels/gpt.c