summaryrefslogtreecommitdiffstats
path: root/hivex/hivex.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-01-19 15:21:06 +0000
committerRichard Jones <rjones@redhat.com>2010-01-28 11:25:30 +0000
commit8635be75c5e5499c388049d10d28bc1313ca832c (patch)
tree827a9d72b805ac32618d6ace59f927b2d7ca522a /hivex/hivex.c
parenta1b72fd0ba5b2fb0a198247b00f9e7230ca8796d (diff)
downloadlibguestfs-8635be75c5e5499c388049d10d28bc1313ca832c.tar.gz
libguestfs-8635be75c5e5499c388049d10d28bc1313ca832c.tar.xz
libguestfs-8635be75c5e5499c388049d10d28bc1313ca832c.zip
hivex: Add missing le32toh conversion around field access.
This was missing. It only worked because we test on a little endian platform.
Diffstat (limited to 'hivex/hivex.c')
-rw-r--r--hivex/hivex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hivex/hivex.c b/hivex/hivex.c
index 7efea9a6..53e63517 100644
--- a/hivex/hivex.c
+++ b/hivex/hivex.c
@@ -763,7 +763,7 @@ get_children (hive_h *h, hive_node_h node,
size_t i;
for (i = 0; i < nr_subkeys_in_lf; ++i) {
- hive_node_h subkey = lf->keys[i].offset;
+ hive_node_h subkey = le32toh (lf->keys[i].offset);
subkey += 0x1000;
if (!IS_VALID_BLOCK (h, subkey)) {
if (h->msglvl >= 2)
@@ -841,7 +841,7 @@ get_children (hive_h *h, hive_node_h node,
size_t j;
for (j = 0; j < le16toh (lf->nr_keys); ++j) {
- hive_node_h subkey = lf->keys[j].offset;
+ hive_node_h subkey = le32toh (lf->keys[j].offset);
subkey += 0x1000;
if (!IS_VALID_BLOCK (h, subkey)) {
if (h->msglvl >= 2)
@@ -1174,7 +1174,7 @@ hivex_value_value (hive_h *h, hive_value_h value,
return ret;
}
- size_t data_offset = vk->data_offset;
+ size_t data_offset = le32toh (vk->data_offset);
data_offset += 0x1000;
if (!IS_VALID_BLOCK (h, data_offset)) {
if (h->msglvl >= 2)