[Asterisk-code-review] GCC12: Fixes for 18+. state_id_by_topic comparing wrong value (asterisk[18])

George Joseph asteriskteam at digium.com
Wed May 4 13:33:03 CDT 2022


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18530 )


Change subject: GCC12: Fixes for 18+.  state_id_by_topic comparing wrong value
......................................................................

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
---
M main/stasis_state.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/30/18530/1

diff --git a/main/stasis_state.c b/main/stasis_state.c
index 75093a0..decf228 100644
--- a/main/stasis_state.c
+++ b/main/stasis_state.c
@@ -113,7 +113,7 @@
 	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);
 }

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18530
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ia0b04d4fff45c92acb7f07132a33622fa341148e
Gerrit-Change-Number: 18530
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220504/ff2ac403/attachment.html>


More information about the asterisk-code-review mailing list