From 49108810d1219e4aa65a65b3578d55b21fd50ba7 Mon Sep 17 00:00:00 2001
From: George Joseph <gjoseph@digium.com>
Date: Wed, 4 May 2022 12:00:27 -0600
Subject: [PATCH] GCC12: Fixes for 18+.  state_id_by_topic comparing wrong
 value

GCC 12 caught an issue in state_id_by_topic where we were
checking a pointer for NULL instead of the contents of
the pointer for '\0'.

ASTERISK-30044

Change-Id: Ia0b04d4fff45c92acb7f07132a33622fa341148e
---
 main/stasis_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main/stasis_state.c b/main/stasis_state.c
index 75093a0e1e..decf228dbe 100644
--- a/main/stasis_state.c
+++ b/main/stasis_state.c
@@ -113,7 +113,7 @@ static const char *state_id_by_topic(struct stasis_topic *manager_topic,
 	id = strchr(stasis_topic_name(state_topic), '/');
 
 	/* The state's unique id should always exist */
-	ast_assert(id != NULL && (id + 1) != NULL);
+	ast_assert(id != NULL && *(id + 1) != '\0');
 
 	return (id + 1);
 }
-- 
GitLab