summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-02-05 12:59:43 +0000
committerRichard Jones <rjones@redhat.com>2010-02-05 12:59:43 +0000
commit348bcd59b3fdfd9f8de353260fb31d745388a64e (patch)
tree396890274fe2e02f8a972d4341b0da81677e082d
parentba48a213aba137fd65df5c8407b6bd49f4476c24 (diff)
downloadlibguestfs-348bcd59b3fdfd9f8de353260fb31d745388a64e.tar.gz
libguestfs-348bcd59b3fdfd9f8de353260fb31d745388a64e.tar.xz
libguestfs-348bcd59b3fdfd9f8de353260fb31d745388a64e.zip
hivex: Documentation and cleanups.
-rw-r--r--hivex/hivex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hivex/hivex.c b/hivex/hivex.c
index 5da50ea1..6752da08 100644
--- a/hivex/hivex.c
+++ b/hivex/hivex.c
@@ -1849,7 +1849,7 @@ allocate_block (hive_h *h, size_t seg_len, const char id[2])
(struct ntreg_hbin_block *) (h->addr + offset);
blockhdr->seg_len = htole32 (- (int32_t) seg_len);
- if (id[0] && id[1] && seg_len >= 6) {
+ if (id[0] && id[1] && seg_len >= sizeof (struct ntreg_hbin_block)) {
blockhdr->id[0] = id[0];
blockhdr->id[1] = id[1];
}
@@ -2547,6 +2547,7 @@ hivex_node_set_values (hive_h *h, hive_node_h node,
}
if (name_len * 2 > le32toh (nk->max_vk_name_len))
+ /* * 2 for UTF16-LE "reencoding" */
nk->max_vk_name_len = htole32 (name_len * 2);
if (values[i].len > le32toh (nk->max_vk_data_len))
nk->max_vk_data_len = htole32 (values[i].len);