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-19 15:01:35 +0000
commit8dacebc8c1902da8b79bf3040ec422dea03bec1f (patch)
tree37606cc5725b1ae080f7ab5c14b7b760f9db0493
parent4fe4c9f274da647fac452bf943176f82f9f05dc1 (diff)
downloadhivex-8dacebc8c1902da8b79bf3040ec422dea03bec1f.tar.gz
hivex-8dacebc8c1902da8b79bf3040ec422dea03bec1f.tar.xz
hivex-8dacebc8c1902da8b79bf3040ec422dea03bec1f.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 5da50ea..6752da0 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);