[Asterisk-code-review] Fixes for GCC 9 (...asterisk[13])

Friendly Automation asteriskteam at digium.com
Wed May 15 06:21:58 CDT 2019


Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11369 )

Change subject: Fixes for GCC 9
......................................................................

Fixes for GCC 9

Various fixes for issues caught by gcc 9.  Mostly snprintf
trying to copy to a buffer potentially too small.

ASTERISK-28412

Change-Id: I9e85a60f3c81d46df16cfdd1c329ce63432cf32e
---
M apps/app_adsiprog.c
M apps/app_followme.c
M channels/chan_console.c
M channels/chan_iax2.c
M pbx/pbx_dundi.c
M utils/extconf.c
M utils/smsq.c
7 files changed, 11 insertions(+), 11 deletions(-)

Approvals:
  mattf: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c
index 6ca02a7..6839a72 100644
--- a/apps/app_adsiprog.c
+++ b/apps/app_adsiprog.c
@@ -590,7 +590,7 @@
 	}
 
 	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;
 	}
 
diff --git a/apps/app_followme.c b/apps/app_followme.c
index 3e0c2c0..dfba0e0 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -222,7 +222,7 @@
 	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. */
diff --git a/channels/chan_console.c b/channels/chan_console.c
index cdd7a25..2d6214b 100644
--- a/channels/chan_console.c
+++ b/channels/chan_console.c
@@ -851,10 +851,10 @@
 	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 */
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 83d9711..43f7d2c 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -3839,7 +3839,7 @@
 /*! \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 @@
 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 @@
 	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);
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 83a1f70..0d82a3f 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -2124,7 +2124,7 @@
 
 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 @@
 	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++;
diff --git a/utils/extconf.c b/utils/extconf.c
index 1a80f66..63ec19d 100644
--- a/utils/extconf.c
+++ b/utils/extconf.c
@@ -3267,7 +3267,7 @@
 		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++;
diff --git a/utils/smsq.c b/utils/smsq.c
index 4934ef7..8fd36ad 100644
--- a/utils/smsq.c
+++ b/utils/smsq.c
@@ -98,7 +98,7 @@
 */
 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;

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I9e85a60f3c81d46df16cfdd1c329ce63432cf32e
Gerrit-Change-Number: 11369
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: mattf <creslin at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190515/bf0e1b9f/attachment.html>


More information about the asterisk-code-review mailing list