aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-syslog.c
diff options
context:
space:
mode:
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2008-06-30 15:23:11 +0000
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2008-06-30 15:23:11 +0000
commit40445cbadfd90b182d3524d754cc73614622eaf9 (patch)
tree1f21d3bddaff4b3646ca624cb5e92bad2663f888 /epan/dissectors/packet-syslog.c
parent5288208502ab66af6a4d512754fcad81e81f6368 (diff)
Create the MTP3 TVB (if any) with a reported length that mirrors the reported length of the frame. That way subdissector exceptions on short frames will (properly) show up as 'packet size limited during capture'.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25637 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-syslog.c')
-rw-r--r--epan/dissectors/packet-syslog.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/epan/dissectors/packet-syslog.c b/epan/dissectors/packet-syslog.c
index 81a11e8f37..0050d21bd8 100644
--- a/epan/dissectors/packet-syslog.c
+++ b/epan/dissectors/packet-syslog.c
@@ -178,9 +178,10 @@ static dissector_handle_t mtp_handle;
* packet so that it can be passed on to the mtp3 dissector for decoding.
*/
static tvbuff_t *
-mtp3_msu_present(gint fac, gint level, const char *msg_str)
+mtp3_msu_present(gint fac, gint level, const char *msg_str, gint chars_truncated)
{
- size_t nbytes, len;
+ size_t nbytes;
+ gint len;
gchar **split_string, *msu_hex_dump;
tvbuff_t *mtp3_tvb = NULL;
guint8 *byte_array;
@@ -211,7 +212,8 @@ mtp3_msu_present(gint fac, gint level, const char *msg_str)
byte_array = convert_string_to_hex(msu_hex_dump, &nbytes);
if (byte_array) {
- mtp3_tvb = tvb_new_real_data(byte_array, nbytes, nbytes);
+ mtp3_tvb = tvb_new_real_data(byte_array, nbytes,
+ nbytes + chars_truncated / 2);
tvb_set_free_cb(mtp3_tvb, g_free);
}
}
@@ -226,7 +228,7 @@ static void
dissect_syslog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
gint pri = -1, lev = -1, fac = -1;
- gint msg_off = 0, msg_len;
+ gint msg_off = 0, msg_len, reported_msg_len;
proto_item *ti;
proto_tree *syslog_tree;
const char *msg_str;
@@ -254,8 +256,10 @@ dissect_syslog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
msg_len = tvb_ensure_length_remaining(tvb, msg_off);
msg_str = tvb_format_text(tvb, msg_off, msg_len);
+ reported_msg_len = tvb_reported_length_remaining(tvb, msg_off);
- mtp3_tvb = mtp3_msu_present(fac, lev, msg_str);
+ mtp3_tvb = mtp3_msu_present(fac, lev, msg_str,
+ (reported_msg_len - msg_len));
if (mtp3_tvb == NULL && check_col(pinfo->cinfo, COL_INFO)) {
if (pri >= 0) {