[Asterisk-code-review] app_osplookup: Avoid a format truncation. (asterisk[13])

Friendly Automation asteriskteam at digium.com
Mon May 11 05:22:23 CDT 2020


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14113 )

Change subject: app_osplookup: Avoid a format truncation.
......................................................................

app_osplookup: Avoid a format truncation.

Ensure that output buffers for the osp_convert_inout
function have sufficient space for additional data
such as brackets and ports.

ASTERISK-28804

Change-Id: Ie54c8241ff0cc653910539c2db00ff2a4869750b
---
M apps/app_osplookup.c
1 file changed, 7 insertions(+), 6 deletions(-)

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



diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c
index eed42c4..7cde455 100644
--- a/apps/app_osplookup.c
+++ b/apps/app_osplookup.c
@@ -447,6 +447,7 @@
 #define OSP_SIZE_UUID		((unsigned int)16)			/* UUID size */
 #define OSP_SIZE_UUIDSTR	((unsigned int)36)			/* UUID string size */
 #define OSP_SIZE_QOSSTR		((unsigned int)1024)		/* QoS string buffer size */
+#define OSP_SIZE_OUTSTR		((unsigned int)288)		/* OSP out size for osp_convert_inout */
 
 /* Call ID Type*/
 #define OSP_CALLID_UNDEF	((unsigned int)0)			/* Undefined */
@@ -1087,8 +1088,8 @@
 	int res;
 	int tokenlen;
 	unsigned char tokenstr[OSP_SIZE_TOKSTR];
-	char src[OSP_SIZE_NORSTR];
-	char dest[OSP_SIZE_NORSTR];
+	char src[OSP_SIZE_OUTSTR];
+	char dest[OSP_SIZE_OUTSTR];
 	unsigned int authorised;
 	unsigned int dummy = 0;
 	int error;
@@ -1516,14 +1517,14 @@
 	char* tmp;
 	unsigned int tokenlen;
 	char token[OSP_SIZE_TOKSTR];
-	char src[OSP_SIZE_NORSTR];
-	char dev[OSP_SIZE_NORSTR];
-	char host[OSP_SIZE_NORSTR];
+	char src[OSP_SIZE_OUTSTR];
+	char dev[OSP_SIZE_OUTSTR];
+	char host[OSP_SIZE_OUTSTR];
 	unsigned int i, type;
 	struct osp_callid callid;
 	unsigned int callidnum;
 	OSPT_CALL_ID* callids[OSP_CALLID_MAXNUM];
-	char dest[OSP_SIZE_NORSTR];
+	char dest[OSP_SIZE_OUTSTR];
 	const char* preferred[2] = { NULL };
 	unsigned int dummy = 0;
 	OSPEFAILREASON reason;

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ie54c8241ff0cc653910539c2db00ff2a4869750b
Gerrit-Change-Number: 14113
Gerrit-PatchSet: 3
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200511/2d8527e7/attachment-0001.html>


More information about the asterisk-code-review mailing list