aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-kink.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-06-16 06:27:18 +0000
committerGuy Harris <guy@alum.mit.edu>2005-06-16 06:27:18 +0000
commit85f9363860d3e5179d66e05a51d82257da5dfd4d (patch)
tree6e289fa802cd42081a9a456520ac56b7c6f6a942 /epan/dissectors/packet-kink.c
parent3b3670d2d3e20de866748037a5a44bd311dc0cfc (diff)
Squelch some compiler warnings.
svn path=/trunk/; revision=14649
Diffstat (limited to 'epan/dissectors/packet-kink.c')
-rw-r--r--epan/dissectors/packet-kink.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/epan/dissectors/packet-kink.c b/epan/dissectors/packet-kink.c
index d725399a1b..67d2ef4472 100644
--- a/epan/dissectors/packet-kink.c
+++ b/epan/dissectors/packet-kink.c
@@ -621,6 +621,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
guint8 next_payload;
guint8 reserved;
guint payload_length,isakmp_length;
+ int length, reported_length;
guint8 inner_next_pload;
guint8 qm, qmmaj, qmmin;
guint16 reserved2;
@@ -672,8 +673,14 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
offset += 2;
if(payload_length > PAYLOAD_HEADER){
- isakmp_length = payload_length - 8;
- isakmp_tvb = tvb_new_subset(tvb, offset, (isakmp_length>tvb_length_remaining(tvb, offset))?tvb_length_remaining(tvb, offset):isakmp_length, isakmp_length);
+ isakmp_length = payload_length - PAYLOAD_HEADER;
+ length = tvb_length_remaining(tvb, offset);
+ if (length > (int)isakmp_length)
+ length = isakmp_length;
+ reported_length = tvb_reported_length_remaining(tvb, offset);
+ if (reported_length > (int)isakmp_length)
+ reported_length = isakmp_length;
+ isakmp_tvb = tvb_new_subset(tvb, offset, length, reported_length);
isakmp_dissect_payloads(isakmp_tvb, payload_kink_isakmp_tree, 1, inner_next_pload, 0, isakmp_length, pinfo);
}
@@ -700,8 +707,10 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
guint16 inner_payload_length;
int start_payload_offset = 0; /* Keep the begining of the payload offset */
const char *data_value;
+#ifdef HAVE_KERBEROS
tvbuff_t *next_tvb;
guint8 *plaintext=NULL;
+#endif
payload_length = tvb_get_ntohs(tvb,offset + TO_PAYLOAD_LENGTH);
start_payload_offset = offset;