38 lines
1.3 KiB
Diff
38 lines
1.3 KiB
Diff
From 47aebc247e6553ffb593512b65296b4e2a8eac0a Mon Sep 17 00:00:00 2001
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
Date: Wed, 30 Aug 2023 15:53:16 +0000
|
|
Subject: [PATCH] partition: Byte-swap partition_entries_lba in test
|
|
|
|
Fixes: commit 7b9301a4c569456a4f96784229a2cd48e8957662
|
|
Fixes: https://gitlab.com/nbdkit/nbdkit/-/merge_requests/38#note_1535695896
|
|
---
|
|
filters/partition/partition-gpt.c | 12 ++++++------
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/filters/partition/partition-gpt.c b/filters/partition/partition-gpt.c
|
|
index ea02e504c..80acddb44 100644
|
|
--- a/filters/partition/partition-gpt.c
|
|
+++ b/filters/partition/partition-gpt.c
|
|
@@ -59,12 +59,12 @@ get_gpt_header (uint8_t *sector,
|
|
* the header, rather than looking in the header to see what LBA
|
|
* they actually start at. Let's at least check for that now.
|
|
*/
|
|
- if (header->partition_entries_lba != 2) {
|
|
- nbdkit_error ("non-standard GPT layout: "
|
|
- "partition entries are not adjacent to header");
|
|
- return -1;
|
|
- }
|
|
- return 0;
|
|
+ if (le64toh (header->partition_entries_lba) != 2) {
|
|
+ nbdkit_error ("non-standard GPT layout: "
|
|
+ "partition entries are not adjacent to header");
|
|
+ return -1;
|
|
+ }
|
|
+ return 0;
|
|
}
|
|
|
|
static void
|
|
--
|
|
2.41.0
|
|
|