MCPcopy Create free account
hub / github.com/coreboot/coreboot / check_size

Function check_size

util/cbfstool/elfheaders.c:126–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124
125
126static int
127check_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
141static void
142elf_ehdr(struct buffer *input, Elf64_Ehdr *ehdr, struct xdr *xdr, int bit64)

Callers 5

phdr_readFunction · 0.85
shdr_readFunction · 0.85
reloc_readFunction · 0.85
strtab_readFunction · 0.85
symtab_readFunction · 0.85

Calls 1

buffer_sizeFunction · 0.85

Tested by

no test coverage detected