[Asterisk-code-review] Compiler fixes for GCC with -Og (asterisk[16])

Alexander Traud asteriskteam at digium.com
Thu Oct 29 08:36:42 CDT 2020


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15078 )


Change subject: Compiler fixes for GCC with -Og
......................................................................

Compiler fixes for GCC with -Og

ASTERISK-29144

Change-Id: I2a72c072083b4492a223c6f9d73d21f4f424db62
---
M addons/ooh323c/src/ooq931.c
M apps/app_directory.c
M apps/app_voicemail.c
M funcs/func_odbc.c
4 files changed, 7 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/78/15078/1

diff --git a/addons/ooh323c/src/ooq931.c b/addons/ooh323c/src/ooq931.c
index 01a8e4a..fc18703 100644
--- a/addons/ooh323c/src/ooq931.c
+++ b/addons/ooh323c/src/ooq931.c
@@ -585,7 +585,7 @@
    unsigned int i;
    ASN1BOOL aligned=TRUE;
    int stat;
-   Q931InformationElement *ie;
+   Q931InformationElement *ie=NULL;
    /* OOCTXT *pctxt = &gH323ep.msgctxt; */
    if(q931Msg ==NULL)
    {
diff --git a/apps/app_directory.c b/apps/app_directory.c
index a47fe3b..f1cd0f3 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -396,7 +396,6 @@
 {
 	struct directory_item **block, *item;
 	int i, limit, res = 0;
-	char buf[9];
 
 	/* option p(n): cellphone pause option */
 	select_item_pause(chan, flags, opts);
@@ -409,13 +408,15 @@
 		for (i = 0; i < limit && !res; i++) {
 			item = block[i];
 
-			snprintf(buf, sizeof(buf), "digits/%d", i + 1);
 			/* Press <num> for <name>, [ extension <ext> ] */
 			res = ast_streamfile(chan, "dir-multi1", ast_channel_language(chan));
 			if (!res)
 				res = ast_waitstream(chan, AST_DIGIT_ANY);
-			if (!res)
+			if (!res) {
+				char buf[7+12]; /* INT_MIN has a length of 12 chars */
+				snprintf(buf, sizeof(buf), "digits/%d", i + 1);
 				res = ast_streamfile(chan, buf, ast_channel_language(chan));
+			}
 			if (!res)
 				res = ast_waitstream(chan, AST_DIGIT_ANY);
 			if (!res)
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index e7ab964..940ca67 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11303,7 +11303,7 @@
 			int skipuser, int max_logins, int silent)
 {
 	int useadsi = 0, valid = 0, logretries = 0;
-	char password[AST_MAX_EXTENSION], *passptr;
+	char password[AST_MAX_EXTENSION], *passptr = NULL;
 	struct ast_vm_user vmus, *vmu = NULL;
 
 	/* If ADSI is supported, setup login screen */
diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c
index e9fe597..acebdcc 100644
--- a/funcs/func_odbc.c
+++ b/funcs/func_odbc.c
@@ -1181,7 +1181,7 @@
 static int init_acf_query(struct ast_config *cfg, char *catg, struct acf_odbc_query **query)
 {
 	const char *tmp;
-	const char *tmp2;
+	const char *tmp2 = NULL;
 	int i;
 
 	if (!cfg || !catg) {

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I2a72c072083b4492a223c6f9d73d21f4f424db62
Gerrit-Change-Number: 15078
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20201029/18ab0f06/attachment.html>


More information about the asterisk-code-review mailing list