From Martin Mathieson:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 5 Apr 2006 16:04:46 +0000 (16:04 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 5 Apr 2006 16:04:46 +0000 (16:04 +0000)
This patch fixes the decode problem mentioned in this bug report:

"3. Frames 9 and 13 are only partially decoded and show up as "Packet size limited during capture" It looks like the decode chokes on the DQ-RI line."

DQ-RI is a localconnectionoptions parameter and shouldn't appear as a top-level parameter. This patch makes sure that all of the single-character top-level parmeter codes are followed immediately by a ':'.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17816 f5534014-38df-0310-8fa8-9805f1628bb7

plugins/mgcp/packet-mgcp.c

index 9d478eea2ef919938c7ccbeaa27c0685180ee87c..2377ed8c7402255d6d3ddb4a442f8b679349a559 100644 (file)
@@ -1072,12 +1072,27 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf)
                switch (tempchar)
                {
                        case 'K':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_rspack;
                                break;
                        case 'B':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_bearerinfo;
                                break;
                        case 'C':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_callid;
                                break;
                        case 'I':
@@ -1095,6 +1110,11 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf)
                                }
                                break;
                        case 'N':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_notifiedentity;
                                break;
                        case 'X':
@@ -1142,6 +1162,11 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf)
                                }
                                break;
                        case 'L':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_localconnoptions;
                                break;
                        case 'M':
@@ -1178,14 +1203,29 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf)
                                }
                                break;
                        case 'S':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_signalreq;
                                buf = &(mi->signalReq);
                                break;
                        case 'D':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_digitmap;
                                mi->hasDigitMap = TRUE;
                                break;
                        case 'O':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_observedevent;
                                buf = &(mi->observedEvents);
                                break;
@@ -1232,15 +1272,35 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf)
                                }
                                break;
                        case 'F':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_reqinfo;
                                break;
                        case 'Q':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_quarantinehandling;
                                break;
                        case 'T':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_detectedevents;
                                break;
                        case 'A':
+                               if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
+                               {
+                                       *hf = &hf_mgcp_param_invalid;
+                                       break;
+                               }
                                *hf = &hf_mgcp_param_capabilities;
                                break;