]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
gcc14: Fix issues caught by gcc 14 1020/head
authorGeorge Joseph <gjoseph@sangoma.com>
Fri, 3 Jan 2025 21:02:22 +0000 (14:02 -0700)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Fri, 3 Jan 2025 23:26:07 +0000 (23:26 +0000)
* test_message.c: Fix segfaults caused by passing NULL as an sprintf fmt.

tests/test_message.c

index dff6bd37b49af88ba929e1c2cc44b0b4e817b584..a8253ba23aab804f1502d33115d738399c46189f 100644 (file)
@@ -680,10 +680,10 @@ AST_TEST_DEFINE(test_message_has_destination_dialplan)
        ast_msg_set_exten(msg, "__I_SHOULD_NOT_EXIST_PLZ__");
        ast_test_validate(test, ast_msg_has_destination(msg) == 0);
 
-       ast_msg_set_exten(msg, NULL);
+       ast_msg_set_exten(msg, "%s", "");
        ast_test_validate(test, ast_msg_has_destination(msg) == 0);
 
-       ast_msg_set_context(msg, NULL);
+       ast_msg_set_context(msg, "%s", "");
        ast_msg_set_exten(msg, TEST_EXTENSION);
        ast_test_validate(test, ast_msg_has_destination(msg) == 0);
 
@@ -716,10 +716,10 @@ AST_TEST_DEFINE(test_message_has_destination_handler)
 
        ast_msg_set_to(msg, "foo");
        ast_msg_set_context(msg, TEST_CONTEXT);
-       ast_msg_set_exten(msg, NULL);
+       ast_msg_set_exten(msg, "%s", "");
        ast_test_validate(test, ast_msg_has_destination(msg) == 1);
 
-       ast_msg_set_context(msg, NULL);
+       ast_msg_set_context(msg, "%s", "");
        ast_test_validate(test, ast_msg_has_destination(msg) == 1);
 
        ast_msg_set_to(msg, "__I_SHOULD_NOT_EXIST_PLZ__");
@@ -756,7 +756,7 @@ AST_TEST_DEFINE(test_message_msg_send)
 
        ast_msg_set_to(msg, "foo");
        ast_msg_set_context(msg, TEST_CONTEXT);
-       ast_msg_set_exten(msg, NULL);
+       ast_msg_set_exten(msg, "%s", "");
        ast_test_validate(test, ast_msg_has_destination(msg) == 1);
 
        if (!ast_msg_send(msg, "testmsg:foo", "blah")) {