fix: Skip the padding field when calculating header checksums
This commit is contained in:
parent
240a4f2f1a
commit
d8faf424ad
@ -203,7 +203,7 @@ uint32_t minitar_checksum_header(const struct tar_header* hdr)
|
|||||||
const uint8_t* ptr = (const uint8_t*)hdr;
|
const uint8_t* ptr = (const uint8_t*)hdr;
|
||||||
|
|
||||||
// Sum up all bytes in the header, as unsigned bytes...
|
// Sum up all bytes in the header, as unsigned bytes...
|
||||||
while (ptr < (const uint8_t*)hdr + sizeof *hdr)
|
while (ptr < (const uint8_t*)hdr + (sizeof *hdr - sizeof hdr->padding))
|
||||||
{
|
{
|
||||||
sum += *ptr;
|
sum += *ptr;
|
||||||
ptr++;
|
ptr++;
|
||||||
|
Loading…
Reference in New Issue
Block a user