[libpri-commits] mattf: trunk r515 - in /trunk: ./ q931.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Fri Jan 11 10:36:11 CST 2008


Author: mattf
Date: Fri Jan 11 10:36:10 2008
New Revision: 515

URL: http://svn.digium.com/view/libpri?view=rev&rev=515
Log:
Merged revisions 514 via svnmerge from 
https://origsvn.digium.com/svn/libpri/branches/1.4

................
r514 | mattf | 2008-01-11 10:34:44 -0600 (Fri, 11 Jan 2008) | 9 lines

Merged revisions 513 via svnmerge from 
https://origsvn.digium.com/svn/libpri/branches/1.2

........
r513 | mattf | 2008-01-11 10:33:52 -0600 (Fri, 11 Jan 2008) | 1 line

We should not be parsing further into the bearer capability IE if the length does not confirm that there actually is data present
........

................

Modified:
    trunk/   (props changed)
    trunk/q931.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.2-merged (original)
+++ branch-1.2-merged Fri Jan 11 10:36:10 2008
@@ -1,1 +1,1 @@
-/branches/1.2:1-332,385,389,415,423,426,445,460,478
+/branches/1.2:1-332,385,389,415,423,426,445,460,478,513

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.4-merged (original)
+++ branch-1.4-merged Fri Jan 11 10:36:10 2008
@@ -1,1 +1,1 @@
-/branches/1.4:1-372,386,390,416,424,427,441,446,462,465,470,479
+/branches/1.4:1-372,386,390,416,424,427,441,446,462,465,470,479,514

Modified: trunk/q931.c
URL: http://svn.digium.com/view/libpri/trunk/q931.c?view=diff&rev=515&r1=514&r2=515
==============================================================================
--- trunk/q931.c (original)
+++ trunk/q931.c Fri Jan 11 10:36:10 2008
@@ -598,8 +598,9 @@
 		pos++;
 	}
 	/* Stop here if no more */
-	if (pos >= len)
+	if (pos >= len - 2)
 		return;
+
 	if ((ie->data[1] & 0x7f) != TRANS_MODE_PACKET) {
 		/* Look for octets 5 and 5.a if present */
 		pri_message(pri, "%c                              Ext: %d  User information layer 1: %s (%d)\n", prefix, (ie->data[pos] >> 7), l12str(ie->data[pos] & 0x7f), ie->data[pos] & 0x7f);
@@ -626,6 +627,10 @@
 	call->transmoderate = ie->data[1] & 0x7f;
 	if (call->transmoderate == PRI_TRANS_CAP_AUDIO_4ESS)
 		call->transmoderate = PRI_TRANS_CAP_3_1K_AUDIO;
+
+	if (pos >= len - 2)
+		return 0;
+
 	if (call->transmoderate != TRANS_MODE_PACKET) {
 		call->userl1 = ie->data[pos] & 0x7f;
 		if (call->userl1 == PRI_LAYER_1_ITU_RATE_ADAPT) {




More information about the libpri-commits mailing list