MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / is_valid_tar_header

Function is_valid_tar_header

src/file_tar.c:100–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100int is_valid_tar_header(const struct tar_posix_header *h)
101{
102 /* Do not remove this check. */
103 if(memcmp(&h->magic, tar_header_gnu, sizeof(tar_header_gnu)) != 0 && memcmp(&h->magic, tar_header_posix, sizeof(tar_header_posix)) != 0)
104 return 0;
105 if(is_valid_checksum_format(h) == 0)
106 return 0;
107 return 1;
108}
109
110/*@
111 @ requires buffer_size >= sizeof(struct tar_posix_header);

Callers 4

header_check_tarFunction · 0.85
photorec_find_blocksizeFunction · 0.85
photorec_check_headerFunction · 0.85

Calls 1

is_valid_checksum_formatFunction · 0.85

Tested by

no test coverage detected