libcbor
0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
|
#include <string.h>
#include <stdbool.h>
Go to the source code of this file.
Functions | |
bool | _cbor_safe_to_multiply (size_t a, size_t b) |
Can a and b be multiplied without overflowing size_t? More... | |
void * | _cbor_alloc_multiple (size_t item_size, size_t item_count) |
Overflow-proof contiguous array allocation. More... | |
void * | _cbor_realloc_multiple (void *pointer, size_t item_size, size_t item_count) |
Overflow-proof contiguous array reallocation. More... | |
void* _cbor_alloc_multiple | ( | size_t | item_size, |
size_t | item_count | ||
) |
Overflow-proof contiguous array allocation.
item_size | |
item_count |
Definition at line 30 of file memory_utils.c.
void* _cbor_realloc_multiple | ( | void * | pointer, |
size_t | item_size, | ||
size_t | item_count | ||
) |
Overflow-proof contiguous array reallocation.
This implements the OpenBSD reallocarray
functionality.
pointer | |
item_size | |
item_count |
Definition at line 39 of file memory_utils.c.
bool _cbor_safe_to_multiply | ( | size_t | a, |
size_t | b | ||
) |
Can a and b be multiplied without overflowing size_t?
Definition at line 25 of file memory_utils.c.