git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hivex: Reenable checksum calculations, but don't check result.
[libguestfs.git]
/
hivex
/
hivex.c
diff --git
a/hivex/hivex.c
b/hivex/hivex.c
index
36c6b0e
..
546ef18
100644
(file)
--- 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 (h->bitmap == NULL)
goto error;
-#if 0 /* Doesn't work. */
/* Header checksum. */
/* 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) {
size_t i;
uint32_t sum = 0;
for (i = 0; i < 0x1fc / 4; ++i) {
- sum
+
= le32toh (*daddr);
+ sum
^
= le32toh (*daddr);
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;
if (sum != le32toh (h->hdr->csum)) {
fprintf (stderr, "hivex: %s: bad checksum in hive header\n", filename);
errno = EINVAL;