]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
GCC12: Fixes for 18+. state_id_by_topic comparing wrong value
authorGeorge Joseph <gjoseph@digium.com>
Wed, 4 May 2022 18:00:27 +0000 (12:00 -0600)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 9 May 2022 12:55:17 +0000 (07:55 -0500)
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

index 75093a0e1e214424c15835a76d7992a7eade0627..decf228dbeed00a1634d80a033b15bbdd6b41642 100644 (file)
@@ -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);
 }