commit e2657a53c59f09ffdddd72bf01caf6a9d080fc56
parent fdec834626d3fa97d9b4a993496f9db691d392b2
Author: MikoĊaj Lenczewski <mblenczewski@gmail.com>
Date: Sun, 12 Feb 2023 16:43:19 +0000
Ensured that riot_inibin_ctx_pushn_*() functions assert out ptr
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/libriot/src/inibin.c b/libriot/src/inibin.c
@@ -41,6 +41,7 @@ riot_inibin_ctx_free(struct riot_inibin_ctx *self) {
b32
riot_inibin_ctx_push_str(struct riot_inibin_ctx *self, u16 len, riot_offptr_t *out) {
assert(self);
+ assert(out);
void *absptr = MEM_POOL_ALLOC(&self->str_pool, char, len);
if (!absptr) return false;
@@ -53,6 +54,7 @@ riot_inibin_ctx_push_str(struct riot_inibin_ctx *self, u16 len, riot_offptr_t *o
b32
riot_inibin_ctx_pushn_field(struct riot_inibin_ctx *self, u16 count, riot_offptr_t *out) {
assert(self);
+ assert(out);
void *absptr = MEM_POOL_ALLOC(&self->field_pool, struct riot_inibin_field, count);
if (!absptr) return false;
@@ -65,6 +67,7 @@ riot_inibin_ctx_pushn_field(struct riot_inibin_ctx *self, u16 count, riot_offptr
b32
riot_inibin_ctx_pushn_pair(struct riot_inibin_ctx *self, u32 count, riot_offptr_t *out) {
assert(self);
+ assert(out);
void *absptr = MEM_POOL_ALLOC(&self->pair_pool, struct riot_inibin_pair, count);
if (!absptr) return false;
@@ -77,6 +80,7 @@ riot_inibin_ctx_pushn_pair(struct riot_inibin_ctx *self, u32 count, riot_offptr_
b32
riot_inibin_ctx_pushn_node(struct riot_inibin_ctx *self, u32 count, riot_offptr_t *out) {
assert(self);
+ assert(out);
void *absptr = MEM_POOL_ALLOC(&self->node_pool, struct riot_inibin_node, count);
if (!absptr) return false;