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

Function buffer_check_magic

util/cbfstool/common.h:111–117  ·  view source on GitHub ↗

Returns whether the buffer begins with the specified magic bytes. */

Source from the content-addressed store, hash-verified

109
110/* Returns whether the buffer begins with the specified magic bytes. */
111static inline bool buffer_check_magic(const struct buffer *b, const char *magic,
112 size_t magic_len)
113{
114 assert(magic);
115 return b && b->size >= magic_len &&
116 memcmp(b->data, magic, magic_len) == 0;
117}
118
119/* Returns the start of the underlying buffer, with the offset undone */
120static inline void *buffer_get_original_backing(const struct buffer *b)

Callers 7

qualcomm_find_hash_mbnv7Function · 0.85
qualcomm_find_hashFunction · 0.85
mediatek_find_hashFunction · 0.85
cbfs_writeFunction · 0.85
cbfs_is_valid_cbfsFunction · 0.85
cbfs_is_valid_entryFunction · 0.85

Calls 1

memcmpFunction · 0.50

Tested by

no test coverage detected