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

George Joseph asteriskteam at digium.com
Tue Jun 25 09:06:18 CDT 2019


George Joseph has submitted this change and it was merged. ( 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(-)

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



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-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190625/29601cd5/attachment-0001.html>


More information about the asterisk-code-review mailing list