X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=inline;f=lib%2Fhivex.c;h=a72fa776907a294666944e5ec5f92f3a111640f5;hb=2419bda3b4b47687c787a2937238fee932ad66e5;hp=2abd5bd908ca3ade10caea69eaa1ba9e9833aa19;hpb=d5ed3c8f348e4ce6bc944ae6312bf9d8bfe852d4;p=hivex.git diff --git a/lib/hivex.c b/lib/hivex.c index 2abd5bd..a72fa77 100644 --- a/lib/hivex.c +++ b/lib/hivex.c @@ -559,7 +559,7 @@ hivex_root (hive_h *h) { hive_node_h ret = h->rootoffs; if (!IS_VALID_BLOCK (h, ret)) { - errno = ENOKEY; + errno = HIVEX_NO_KEY; return 0; } return ret; @@ -1062,7 +1062,7 @@ get_values (hive_h *h, hive_node_h node, size_t i; for (i = 0; i < nr_values; ++i) { - hive_node_h value = vlist->offset[i]; + hive_node_h value = le32toh (vlist->offset[i]); value += 0x1000; if (!IS_VALID_BLOCK (h, value)) { if (h->msglvl >= 2) @@ -2748,8 +2748,7 @@ hivex_node_set_value (hive_h *h, hive_node_h node, leave_partial: for (int i = 0; i < alloc_ct; i += 2) { - if (values[i / 2].value != NULL) - free (values[i / 2].value); + free (values[i / 2].value); if (i + 1 < alloc_ct && values[i / 2].key != NULL) free (values[i / 2].key); }