]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
pbx_variables: initialize uninitialized variable
authorNaveen Albert <asterisk@phreaknet.org>
Mon, 13 Dec 2021 22:49:52 +0000 (22:49 +0000)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Wed, 15 Dec 2021 16:49:49 +0000 (10:49 -0600)
The variable cp4 in a variable substitution function
can potentially be used without being initialized
currently. This causes Asterisk to no longer compile.

This initializes cp4 to NULL to make the compiler
happy.

ASTERISK-29803 #close

Change-Id: I392579cbb76db2795d5820c9427cf55fbcee9e72

main/pbx_variables.c

index 2088740c7c2e69459d595ab0b2a191112c83bf13..7a859890c37eef8c0ce0b4b65a9a580afedb2e2a 100644 (file)
@@ -692,7 +692,7 @@ void pbx_substitute_variables_helper_full_location(struct ast_channel *c, struct
                        int offset;
                        int offset2;
                        int isfunction;
-                       char *cp4;
+                       char *cp4 = NULL;
                        char workspace[VAR_BUF_SIZE] = "";
 
                        /* We have a variable.  Find the start and end, and determine