aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rtps2.c
diff options
context:
space:
mode:
authorjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2011-10-21 08:32:10 +0000
committerjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2011-10-21 08:32:10 +0000
commitfff52aaad560f59d1127c5778ae336331170f824 (patch)
treec50c59797ec274da9924b180c8a4190b995ac4d2 /epan/dissectors/packet-rtps2.c
parent30fe3d706e41b3c0860d57b5457163561c4f5985 (diff)
Fix for bug 6449:
Last RTPS2 submessage could have zero as octets_to_next_header. From me: coding style unused parameters. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39506 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-rtps2.c')
-rw-r--r--epan/dissectors/packet-rtps2.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/epan/dissectors/packet-rtps2.c b/epan/dissectors/packet-rtps2.c
index 9047afe091..51c8a5cd02 100644
--- a/epan/dissectors/packet-rtps2.c
+++ b/epan/dissectors/packet-rtps2.c
@@ -5524,7 +5524,7 @@ static void dissect_PAD(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PAD |X|X|X|X|X|X|X|E| octetsToNextHeader |
@@ -5533,7 +5533,7 @@ static void dissect_PAD(tvbuff_t *tvb,
if (tree) {
rtps_util_decode_flags(tree, tvb, offset + 1, flags, PAD_FLAGS);
- if (octets_to_next_header != 0) {
+ if (NEXT_guint16(tvb, offset + 2, little_endian) != 0) {
proto_tree_add_uint_format(tree,
hf_rtps_sm_octets_to_next_header,
tvb,
@@ -6302,7 +6302,7 @@ static void dissect_ACKNACK(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id ) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -6435,7 +6435,7 @@ static void dissect_NACK_FRAG(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id ) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -6556,7 +6556,7 @@ static void dissect_HEARTBEAT(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -6674,7 +6674,7 @@ static void dissect_HEARTBEAT_BATCH(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/*
@@ -6817,7 +6817,7 @@ static void dissect_HEARTBEAT_FRAG(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -6939,7 +6939,7 @@ static void dissect_GAP(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -7042,7 +7042,7 @@ static void dissect_INFO_TS(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -7112,7 +7112,7 @@ static void dissect_INFO_SRC(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -7237,7 +7237,7 @@ static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -7320,7 +7320,7 @@ static void dissect_INFO_DST(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -7389,7 +7389,7 @@ static void dissect_INFO_REPLY(tvbuff_t *tvb,
int octets_to_next_header,
proto_tree *tree,
char * info_summary_text,
- guint16 G_GNUC_UNUSED vendor_id) {
+ guint16 vendor_id _U_) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -8706,7 +8706,9 @@ static gboolean dissect_rtps(tvbuff_t *tvb,
little_endian = ((flags & FLAG_E) != 0);
/* octet-to-next-header */
- octets_to_next_header = NEXT_guint16(tvb, offset + 2, little_endian);
+ octets_to_next_header = NEXT_guint16(tvb, offset + 2, little_endian);
+ if (octets_to_next_header == 0)
+ octets_to_next_header = tvb_reported_length_remaining(tvb, offset + 4);
next_submsg = offset + octets_to_next_header + 4;
/* Set length of this item */