From: George Joseph Date: Wed, 4 May 2022 18:00:27 +0000 (-0600) Subject: GCC12: Fixes for 18+. state_id_by_topic comparing wrong value X-Git-Tag: 18.13.0-rc1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfd2e4006be54c017f8d101118c5d0b284213f60;p=thirdparty%2Fasterisk.git 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 --- 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); }