aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-giop.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-09-09 17:03:44 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2015-09-09 21:22:43 +0000
commit302b03a0bbe3702f93eced884d8103528c35e8d7 (patch)
treeb145eb351f128c4b66867f3b9886f4f06983b0d7 /epan/dissectors/packet-giop.c
parent2ec5e5484e5344fb12671d31ece7c0373d5ac18c (diff)
GIOP: increase the maximum message size allowed to 10MB
Also make it configurable through preferences Bug: 11508 Change-Id: Ic2cc085376d61892996b33ed45f906e4b3ff19da Reviewed-on: https://code.wireshark.org/review/10449 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-giop.c')
-rw-r--r--epan/dissectors/packet-giop.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index 45ee37cb06..3898f44d0d 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -867,8 +867,8 @@ static value_string_ext giop_code_set_vals_ext = VALUE_STRING_EXT_INIT(giop_code
static const guint GIOP_MAJOR = 1;
static const guint GIOP_MINOR = 2;
-/* 1 Mb Used as a sanity check to ensure correct endian of message size field */
-#define GIOP_MAX_MESSAGE_SIZE 1024*1000
+/* 10 MB Used as a sanity check to ensure correct endian of message size field */
+static guint giop_max_message_size = 10*1048576;
static const value_string reply_status_types[] = {
@@ -4770,7 +4770,7 @@ static int dissect_giop_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree
message_size);
ti = proto_tree_add_uint(header_tree, hf_giop_message_size, tvb, 8, 4, message_size);
- if (message_size > GIOP_MAX_MESSAGE_SIZE)
+ if (message_size > giop_max_message_size)
{
expert_add_info_format(pinfo, ti, &ei_giop_message_size_too_big,
"Message size %u is too big, perhaps it's an endian issue?", message_size);
@@ -4929,7 +4929,7 @@ get_giop_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _
message_size = tvb_get_letohl(tvb, 8 + offset);
/* Make sure the size is reasonable, otherwise just take the header */
- if (message_size > GIOP_MAX_MESSAGE_SIZE)
+ if (message_size > giop_max_message_size)
return GIOP_HEADER_SIZE;
return message_size + GIOP_HEADER_SIZE;
@@ -5544,6 +5544,10 @@ proto_register_giop (void)
"Reassemble fragmented GIOP messages",
"Whether fragmented GIOP messages should be reassembled",
&giop_reassemble);
+ prefs_register_uint_preference(giop_module, "max_message_size",
+ "Maximum allowed message size",
+ "Maximum allowed message size in bytes (default=10485760)",
+ 10, &giop_max_message_size);
prefs_register_filename_preference(giop_module, "ior_txt", "Stringified IORs",
"File containing stringified IORs, one per line.", &giop_ior_file);