summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-01-15 12:41:34 +0000
committerRichard Jones <rjones@redhat.com>2010-01-15 12:41:34 +0000
commitac8ee450dbe65990378ca9c13094b7187ae70b0d (patch)
tree9eb2fefc81c61d4cb7521860e517c63770b2179b
parentadd1be720e4f4abf95bec17eea346436c8d776c7 (diff)
downloadlibguestfs-ac8ee450dbe65990378ca9c13094b7187ae70b0d.tar.gz
libguestfs-ac8ee450dbe65990378ca9c13094b7187ae70b0d.tar.xz
libguestfs-ac8ee450dbe65990378ca9c13094b7187ae70b0d.zip
hivex: Reenable checksum calculations, but don't check result.
-rw-r--r--hivex/hivex.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hivex/hivex.c b/hivex/hivex.c
index 36c6b0eb..546ef18d 100644
--- a/hivex/hivex.c
+++ b/hivex/hivex.c
@@ -283,15 +283,16 @@ hivex_open (const char *filename, int flags)
if (h->bitmap == NULL)
goto error;
-#if 0 /* Doesn't work. */
/* Header checksum. */
- uint32_t *daddr = h->addr;
+ uint32_t *daddr = (uint32_t *) h->addr;
size_t i;
uint32_t sum = 0;
for (i = 0; i < 0x1fc / 4; ++i) {
- sum += le32toh (*daddr);
+ sum ^= le32toh (*daddr);
daddr++;
}
+
+#if 0 /* Doesn't work. */
if (sum != le32toh (h->hdr->csum)) {
fprintf (stderr, "hivex: %s: bad checksum in hive header\n", filename);
errno = EINVAL;