X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=hivex%2Fhivex.c;h=b106a108fed02b61306f909c99779cd60d7e1c96;hb=d7175703994997a6c40cf78cd74809b82deb1ed4;hp=c8257a3ee19894d8dd6569a55239c15e0e9b17d3;hpb=aef0d618b08dc9fb27fb3a729dd8926cff26ae0b;p=libguestfs.git diff --git a/hivex/hivex.c b/hivex/hivex.c index c8257a3..b106a10 100644 --- a/hivex/hivex.c +++ b/hivex/hivex.c @@ -195,7 +195,7 @@ struct ntreg_nk_record { struct ntreg_lf_record { int32_t seg_len; - char id[2]; /* "lf" */ + char id[2]; /* "lf"|"lh" */ uint16_t nr_keys; /* number of keys in this record */ struct { uint32_t offset; /* offset of nk-record for this subkey */ @@ -803,7 +803,7 @@ get_children (hive_h *h, hive_node_h node, /* Count total number of children. */ size_t i, count = 0; for (i = 0; i < nr_offsets; ++i) { - hive_node_h offset = ri->offset[i]; + hive_node_h offset = le32toh (ri->offset[i]); offset += 0x1000; if (!IS_VALID_BLOCK (h, offset)) { if (h->msglvl >= 2) @@ -839,7 +839,7 @@ get_children (hive_h *h, hive_node_h node, * something reasonable above. */ for (i = 0; i < nr_offsets; ++i) { - hive_node_h offset = ri->offset[i]; + hive_node_h offset = le32toh (ri->offset[i]); offset += 0x1000; if (!IS_VALID_BLOCK (h, offset)) { if (h->msglvl >= 2)