aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-12-18 15:54:32 +0000
committerEvan Huus <eapache@gmail.com>2013-12-18 15:54:32 +0000
commit8f665d9b36a7b7b3ae30b9e7afbc7724957e0bc1 (patch)
tree93ea8124c60b6c5e55a1cec422eda62557642cef
parent197c2ffac6913dd3953409bef42af54cfb1f3dfe (diff)
Add a sixteenth element to all BCD digit sets to avoid garbage values when
decoding corrupt bytes. Some of these digit sets could probably be deduplicated... svn path=/trunk/; revision=54224
-rw-r--r--asn1/ansi_map/packet-ansi_map-template.c2
-rw-r--r--epan/dissectors/packet-ansi_map.c2
-rw-r--r--epan/dissectors/packet-bssap.c4
-rw-r--r--epan/dissectors/packet-gsm_a_common.c4
-rw-r--r--epan/dissectors/packet-gsm_a_common.h8
-rw-r--r--epan/dissectors/packet-gsm_a_dtap.c2
-rw-r--r--epan/dissectors/packet-p7.c21
-rw-r--r--epan/tvbuff.c4
-rw-r--r--epan/tvbuff.h2
9 files changed, 21 insertions, 28 deletions
diff --git a/asn1/ansi_map/packet-ansi_map-template.c b/asn1/ansi_map/packet-ansi_map-template.c
index 8e73596a58..ef92a7d925 100644
--- a/asn1/ansi_map/packet-ansi_map-template.c
+++ b/asn1/ansi_map/packet-ansi_map-template.c
@@ -568,7 +568,7 @@ static int dissect_ansi_map_SystemMyTypeCode(gboolean implicit_tag _U_, tvbuff_t
static dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
- '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
+ '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#','?'
}
};
diff --git a/epan/dissectors/packet-ansi_map.c b/epan/dissectors/packet-ansi_map.c
index 1d7e9a7991..4335370738 100644
--- a/epan/dissectors/packet-ansi_map.c
+++ b/epan/dissectors/packet-ansi_map.c
@@ -1356,7 +1356,7 @@ static int dissect_ansi_map_SystemMyTypeCode(gboolean implicit_tag _U_, tvbuff_t
static dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
- '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
+ '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#','?'
}
};
diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c
index 665e82333b..3919c20176 100644
--- a/epan/dissectors/packet-bssap.c
+++ b/epan/dissectors/packet-bssap.c
@@ -620,7 +620,7 @@ dissect_bssap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
- '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
+ '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#','?'
}
};
#endif
@@ -628,7 +628,7 @@ static dgt_set_t Dgt_tbcd = {
static dgt_set_t Dgt1_9_bcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
- '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
+ '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?','?'
}
};
/* Assumes the rest of the tvb contains the digits to be turned into a string
diff --git a/epan/dissectors/packet-gsm_a_common.c b/epan/dissectors/packet-gsm_a_common.c
index f5c5442610..3680e03a2e 100644
--- a/epan/dissectors/packet-gsm_a_common.c
+++ b/epan/dissectors/packet-gsm_a_common.c
@@ -1928,14 +1928,14 @@ guint16 elem_v_short(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint p
static dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
- '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
+ '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#','?'
}
};
static dgt_set_t Dgt1_9_bcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
- '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
+ '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?','?'
}
};
diff --git a/epan/dissectors/packet-gsm_a_common.h b/epan/dissectors/packet-gsm_a_common.h
index b1b42f835e..af8f2c7562 100644
--- a/epan/dissectors/packet-gsm_a_common.h
+++ b/epan/dissectors/packet-gsm_a_common.h
@@ -59,14 +59,6 @@
/* PROTOTYPES/FORWARDS */
typedef guint16 (*elem_fcn)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
typedef void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
-#if 0
-/* XXX moved to tvbuff.h, clean up later */
-typedef struct dgt_set_t
-{
- unsigned char out[15];
-}
-dgt_set_t;
-#endif
int my_dgt_tbcd_unpack(
char *out, /* ASCII pattern out */
guchar *in, /* packed pattern in */
diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c
index c2b2215ada..aeee86956a 100644
--- a/epan/dissectors/packet-gsm_a_dtap.c
+++ b/epan/dissectors/packet-gsm_a_dtap.c
@@ -566,7 +566,7 @@ gint ett_gsm_dtap_elem[NUM_GSM_DTAP_ELEM];
static dgt_set_t Dgt_mbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
- '0','1','2','3','4','5','6','7','8','9','*','#','a','b','c'
+ '0','1','2','3','4','5','6','7','8','9','*','#','a','b','c','?'
}
};
diff --git a/epan/dissectors/packet-p7.c b/epan/dissectors/packet-p7.c
index a3b5108555..044b2eb3f8 100644
--- a/epan/dissectors/packet-p7.c
+++ b/epan/dissectors/packet-p7.c
@@ -43,6 +43,7 @@
#include "packet-acse.h"
#include "packet-ros.h"
#include "packet-rtse.h"
+#include "packet-p7.h"
#include "packet-p1.h"
#include <epan/strutil.h>
@@ -123,7 +124,7 @@ static int proto_p7 = -1;
#define ub_ua_restrictions 16
/*--- End of included file: packet-p7-val.h ---*/
-#line 60 "../../asn1/p7/packet-p7-template.c"
+#line 61 "../../asn1/p7/packet-p7-template.c"
/*--- Included file: packet-p7-hf.c ---*/
@@ -495,7 +496,7 @@ static int hf_p7_T_entry_class_problem_entry_class_not_subscribed = -1;
static int hf_p7_T_entry_class_problem_inappropriate_entry_class = -1;
/*--- End of included file: packet-p7-hf.c ---*/
-#line 62 "../../asn1/p7/packet-p7-template.c"
+#line 63 "../../asn1/p7/packet-p7-template.c"
/* Initialize the subtree pointers */
static gint ett_p7 = -1;
@@ -637,7 +638,7 @@ static gint ett_p7_RTSE_apdus = -1;
static gint ett_p7_RTABapdu = -1;
/*--- End of included file: packet-p7-ett.c ---*/
-#line 66 "../../asn1/p7/packet-p7-template.c"
+#line 67 "../../asn1/p7/packet-p7-template.c"
/*--- Included file: packet-p7-table.c ---*/
@@ -680,7 +681,7 @@ static const value_string p7_err_code_string_vals[] = {
/*--- End of included file: packet-p7-table.c ---*/
-#line 68 "../../asn1/p7/packet-p7-template.c"
+#line 69 "../../asn1/p7/packet-p7-template.c"
/*--- Included file: packet-p7-fn.c ---*/
@@ -4083,7 +4084,7 @@ static void dissect_RTSE_apdus_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pr
/*--- End of included file: packet-p7-fn.c ---*/
-#line 70 "../../asn1/p7/packet-p7-template.c"
+#line 71 "../../asn1/p7/packet-p7-template.c"
/*--- Included file: packet-p7-table11.c ---*/
@@ -4115,7 +4116,7 @@ static const ros_opr_t p7_opr_tab[] = {
/*--- End of included file: packet-p7-table11.c ---*/
-#line 72 "../../asn1/p7/packet-p7-template.c"
+#line 73 "../../asn1/p7/packet-p7-template.c"
/*--- Included file: packet-p7-table21.c ---*/
#line 1 "../../asn1/p7/packet-p7-table21.c"
@@ -4154,7 +4155,7 @@ static const ros_err_t p7_err_tab[] = {
/*--- End of included file: packet-p7-table21.c ---*/
-#line 73 "../../asn1/p7/packet-p7-template.c"
+#line 74 "../../asn1/p7/packet-p7-template.c"
static const ros_info_t p7_ros_info = {
"P7",
@@ -5634,7 +5635,7 @@ void proto_register_p7(void) {
NULL, HFILL }},
/*--- End of included file: packet-p7-hfarr.c ---*/
-#line 92 "../../asn1/p7/packet-p7-template.c"
+#line 93 "../../asn1/p7/packet-p7-template.c"
};
/* List of subtrees */
@@ -5778,7 +5779,7 @@ void proto_register_p7(void) {
&ett_p7_RTABapdu,
/*--- End of included file: packet-p7-ettarr.c ---*/
-#line 98 "../../asn1/p7/packet-p7-template.c"
+#line 99 "../../asn1/p7/packet-p7-template.c"
};
module_t *p7_module;
@@ -5837,7 +5838,7 @@ void proto_reg_handoff_p7(void) {
/*--- End of included file: packet-p7-dis-tab.c ---*/
-#line 124 "../../asn1/p7/packet-p7-template.c"
+#line 125 "../../asn1/p7/packet-p7-template.c"
/* APPLICATION CONTEXT */
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 95b7c4d3d9..5d74393b42 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -2738,8 +2738,8 @@ tvb_bytes_to_str_punct(tvbuff_t *tvb, const gint offset, const gint len, const g
*/
static dgt_set_t Dgt1_9_bcd = {
{
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e */
- '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
+ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f*/
+ '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?','?'
}
};
const gchar *
diff --git a/epan/tvbuff.h b/epan/tvbuff.h
index 6a5ffaf931..b64e8a8421 100644
--- a/epan/tvbuff.h
+++ b/epan/tvbuff.h
@@ -675,7 +675,7 @@ WS_DLL_PUBLIC gchar *tvb_bytes_to_str(tvbuff_t *tvb, const gint offset,
*/
typedef struct dgt_set_t
{
- const unsigned char out[15];
+ const unsigned char out[16];
}
dgt_set_t;