From 20d3dc016765a5d124a10103a87969c423704338 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 23 Jun 2022 13:48:06 +0200 Subject: [PATCH] [CORE] fsm: Add asserts to validate ogs_fsm_t is not null (#1619) --- lib/core/ogs-fsm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core/ogs-fsm.c b/lib/core/ogs-fsm.c index 8eb016ce0..725aba6ac 100644 --- a/lib/core/ogs-fsm.c +++ b/lib/core/ogs-fsm.c @@ -38,6 +38,7 @@ void ogs_fsm_init(void *sm, void *event) { ogs_fsm_t *s = sm; fsm_event_t *e = event; + ogs_assert(s); if (s->init != NULL) { (*s->init)(s, e); @@ -56,6 +57,7 @@ void ogs_fsm_dispatch(void *sm, void *event) { ogs_fsm_t *s = sm; fsm_event_t *e = event; + ogs_assert(s); ogs_fsm_handler_t tmp = s->state; if (e) @@ -81,6 +83,7 @@ void ogs_fsm_fini(void *sm, void *event) { ogs_fsm_t *s = sm; fsm_event_t *e = event; + ogs_assert(s); if (s->fini != s->state) { if (e) {