[Asterisk-code-review] sig_pri: Address gcc9 issues (...asterisk[13])

George Joseph asteriskteam at digium.com
Mon Jun 24 08:30:48 CDT 2019


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11490


Change subject: sig_pri:  Address gcc9 issues
......................................................................

sig_pri:  Address gcc9 issues

A few more format truncation issues addressed.

Change-Id: I047f373169caaca0eec4889d3c0e5e10f130017a
---
M channels/sig_pri.c
1 file changed, 5 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/90/11490/1

diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index e777f95..ecf160d 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -6048,11 +6048,14 @@
 
 	/* Setup the user tag for party id's from this device for this call. */
 	if (pri->append_msn_to_user_tag) {
-		snprintf(pri->pvts[chanpos]->user_tag,
+		int len = snprintf(pri->pvts[chanpos]->user_tag,
 			sizeof(pri->pvts[chanpos]->user_tag), "%s_%s",
 			pri->initial_user_tag,
 			pri->nodetype == PRI_NETWORK
 				? plancallingnum : e->ring.callednum);
+		if (len >= sizeof(pri->pvts[chanpos]->user_tag)) {
+			ast_log(LOG_WARNING, "user_tag '%s' truncated\n", pri->pvts[chanpos]->user_tag);
+		}
 	} else {
 		ast_copy_string(pri->pvts[chanpos]->user_tag,
 			pri->initial_user_tag, sizeof(pri->pvts[chanpos]->user_tag));
@@ -6447,7 +6450,7 @@
 
 		if (e) {
 			int chanpos = -1;
-			char cause_str[35];
+			char cause_str[36];
 
 			if (pri->debug) {
 				ast_verbose("Span %d: Processing event %s(%d)\n",

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I047f373169caaca0eec4889d3c0e5e10f130017a
Gerrit-Change-Number: 11490
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190624/3358ab58/attachment.html>


More information about the asterisk-code-review mailing list