From def947e21fcfb43833a10a4f588b413e2a78bdb4 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 9 Feb 2010 10:17:53 +0000 Subject: Don't trust the length field in a V5 sample to be valid. This appears to fix bug 4473. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31846 f5534014-38df-0310-8fa8-9805f1628bb7 --- epan/dissectors/packet-sflow.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'epan/dissectors/packet-sflow.c') diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c index 63365e074d..34f4328682 100644 --- a/epan/dissectors/packet-sflow.c +++ b/epan/dissectors/packet-sflow.c @@ -2632,6 +2632,8 @@ dissect_sflow_245_samples(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g default: break; } + /* Make sure the length doesn't run past the end of the packet */ + tvb_ensure_bytes_exist(tvb, offset, length); /* current offset points to sample length field, which is 4 bytes from the beginning of the packet*/ offset += length; } else { /* unknown enterprise format, what to do?? */ -- cgit v1.2.3