Fix UB in load_sha256
test caused by accessing incorrect union field
This commit is contained in:
parent
a8fcdbd140
commit
0a210b4e7e
2 changed files with 2 additions and 2 deletions
|
@ -150,7 +150,7 @@ char* haggis_linkmap_get_or_add(haggis_linkmap *map, ino_t inode, char * path) {
|
|||
ino_t val;
|
||||
u8 bytes[sizeof(ino_t)];
|
||||
} key;
|
||||
char * target = NULL;
|
||||
char * target = "";
|
||||
size_t idx, hash;
|
||||
haggis_bucket *b;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ int main() {
|
|||
if (haggis_load_cksum(f, &cksum)) return 1;
|
||||
assert(cksum.tag == sha256);
|
||||
for (i = 0; i < 32; i++) {
|
||||
assert(cksum.sum.sha1[i] == (uint8_t)i);
|
||||
assert(cksum.sum.sha256[i] == (uint8_t)i);
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue