]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fixes for GCC 9
authorGeorge Joseph <gjoseph@digium.com>
Fri, 10 May 2019 15:48:28 +0000 (09:48 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Fri, 10 May 2019 16:19:50 +0000 (10:19 -0600)
Various fixes for issues caught by gcc 9.  Mostly snprintf
trying to copy to a buffer potentially too small.

ASTERISK-28412

Change-Id: I9e85a60f3c81d46df16cfdd1c329ce63432cf32e

apps/app_adsiprog.c
apps/app_followme.c
channels/chan_console.c
channels/chan_iax2.c
pbx/pbx_dundi.c
utils/extconf.c
utils/smsq.c

index 6ca02a70778c9417a846023253541400be8445c1..6839a72ff7f9050385661e7a44be13223ae7768c 100644 (file)
@@ -590,7 +590,7 @@ static struct adsi_subscript *getsubbyname(struct adsi_script *state, char *name
        }
 
        if (state->numsubs > 127) {
-               ast_log(LOG_WARNING, "No more subscript space at line %d of %s\n", lineno, script);
+               ast_log(LOG_WARNING, "No more subscript space at line %d of %s\n", lineno, S_OR(script, "unknown"));
                return NULL;
        }
 
index 3e0c2c081928c109c301de6e56d08e84e1aaa882..dfba0e0addc388776a5f7c99b45c3b43cb2633ba 100644 (file)
@@ -222,7 +222,7 @@ struct findme_user {
        long digts;
        int ynidx;
        int state;
-       char dialarg[256];
+       char dialarg[768];
        /*! Collected digits to accept/decline the call. */
        char yn[MAX_YN_STRING];
        /*! TRUE if the outgoing call is answered. */
index cdd7a25cbdeb7cdb81eff31195bd05bcaca5c1e4..2d6214b364227e3d3b7a6b877d033206a9bd7aa0 100644 (file)
@@ -851,10 +851,10 @@ static char *cli_console_dial(struct ast_cli_entry *e, int cmd, struct ast_cli_a
        if (a->argc == e->args + 1) {
                char *ext = NULL, *con = NULL;
                s = ast_ext_ctx(pvt, a->argv[e->args], &ext, &con);
-               ast_debug(1, "provided '%s', exten '%s' context '%s'\n",
-                       a->argv[e->args], mye, myc);
                mye = ext;
                myc = con;
+               ast_debug(1, "provided '%s', exten '%s' context '%s'\n",
+                       a->argv[e->args], mye, myc);
        }
 
        /* supply default values if needed */
index 83d9711273898b5087cf87ab1cfde6333ab86e0f..43f7d2c635d2a2ee5509d66ee12770770292a59c 100644 (file)
@@ -3839,7 +3839,7 @@ static int peer_status(struct iax2_peer *peer, char *status, int statuslen)
 /*! \brief Show one peer in detail */
 static char *handle_cli_iax2_show_peer(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
-       char status[30];
+       char status[64];
        char cbuf[256];
        struct iax2_peer *peer;
        struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
@@ -6861,7 +6861,7 @@ struct show_peers_context {
 static void _iax2_show_peers_one(int fd, struct mansession *s, struct show_peers_context *cont, struct iax2_peer *peer)
 {
        char name[256] = "";
-       char status[20];
+       char status[64];
        int retstatus;
        struct ast_str *encmethods = ast_str_alloca(256);
 
@@ -14973,7 +14973,7 @@ static int peers_data_provider_get(const struct ast_data_search *search,
        struct ast_data *data_peer;
        struct iax2_peer *peer;
        struct ao2_iterator i;
-       char status[20];
+       char status[64];
        struct ast_str *encmethods = ast_str_alloca(256);
 
        i = ao2_iterator_init(peers, 0);
index 83a1f7088e0dfecc8c2dc3e6d4c6207595a2b284..0d82a3f338bab3816db9543ae5386be436b2df59 100644 (file)
@@ -2124,7 +2124,7 @@ static void build_secret(char *secret, int seclen)
 
 static void save_secret(const char *newkey, const char *oldkey)
 {
-       char tmp[256];
+       char tmp[350];
        if (oldkey)
                snprintf(tmp, sizeof(tmp), "%s;%s", oldkey, newkey);
        else
@@ -2703,7 +2703,7 @@ static char *dundi_show_peers(struct ast_cli_entry *e, int cmd, struct ast_cli_a
        AST_LIST_LOCK(&peers);
        ast_cli(a->fd, FORMAT2, "EID", "Host", "Port", "Model", "AvgTime", "Status");
        AST_LIST_TRAVERSE(&peers, peer, list) {
-               char status[20];
+               char status[64];
                int print_line = -1;
                char srch[2000];
                total_peers++;
index 1a80f66a608fe123d40d0baafaf19209a022abc1..63ec19d8db45ce6c023f996574509738111464a0 100644 (file)
@@ -3267,7 +3267,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                if (do_include || do_exec) {
                        if (c) {
                                char *cur2;
-                               char real_inclusion_name[256];
+                               char real_inclusion_name[525];
 
                                /* Strip off leading and trailing "'s and <>'s */
                                while((*c == '<') || (*c == '>') || (*c == '\"')) c++;
index 4934ef77846a02025f9ef4506daf78bf7f13a826..8fd36adba55704ea6736821dc79442312f0cabc5 100644 (file)
@@ -98,7 +98,7 @@ static int utf8decode (unsigned char **pp)
 */
 static char txqcheck (char *dir, char *queue, char subaddress, char *channel, char *callerid, int wait, int delay, int retries, int concurrent)
 {
-   char ogname[100],
+   char ogname[300],
      temp[100],
      dirname[100],
     *p=NULL;