[asterisk-commits] qwell: trunk r78378 - in /trunk: ./ channels/chan_skinny.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 7 13:26:20 CDT 2007


Author: qwell
Date: Tue Aug  7 13:26:19 2007
New Revision: 78378

URL: http://svn.digium.com/view/asterisk?view=rev&rev=78378
Log:
Merged revisions 78375 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r78375 | qwell | 2007-08-07 13:25:15 -0500 (Tue, 07 Aug 2007) | 3 lines

Properly check the capabilities count to avoid a segfault.
(ASA-2007-019)

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_skinny.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=78378&r1=78377&r2=78378
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Tue Aug  7 13:26:19 2007
@@ -221,9 +221,11 @@
 	} payloads;
 };
 
+#define SKINNY_MAX_CAPABILITIES 18
+
 struct capabilities_res_message {
 	uint32_t count;
-	struct station_capabilities caps[18];
+	struct station_capabilities caps[SKINNY_MAX_CAPABILITIES];
 };
 
 #define SPEED_DIAL_STAT_REQ_MESSAGE 0x000A
@@ -3746,11 +3748,15 @@
 {
 	struct skinny_device *d = s->device;
 	struct skinny_line *l;
-	int count = 0;
+	uint32_t count = 0;
 	int codecs = 0;
 	int i;
 
 	count = letohl(req->data.caps.count);
+	if (count > SKINNY_MAX_CAPABILITIES) {
+		count = SKINNY_MAX_CAPABILITIES;
+		ast_log(LOG_WARNING, "Received more capabilities than we can handle (%d).  Ignoring the rest.\n", SKINNY_MAX_CAPABILITIES);
+	}
 
 	for (i = 0; i < count; i++) {
 		int acodec = 0;




More information about the asterisk-commits mailing list