| 124 | |
| 125 | |
| 126 | static int |
| 127 | check_size(const struct buffer *b, size_t offset, size_t size, const char *desc) |
| 128 | { |
| 129 | if (size == 0) |
| 130 | return 0; |
| 131 | |
| 132 | if (offset >= buffer_size(b) || (offset + size) > buffer_size(b)) { |
| 133 | ERROR("The file is not large enough for the '%s'. " |
| 134 | "%zu bytes @ offset %zu, input %zu bytes.\n", |
| 135 | desc, size, offset, buffer_size(b)); |
| 136 | return -1; |
| 137 | } |
| 138 | return 0; |
| 139 | } |
| 140 | |
| 141 | static void |
| 142 | elf_ehdr(struct buffer *input, Elf64_Ehdr *ehdr, struct xdr *xdr, int bit64) |
no test coverage detected