diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-02-09 10:17:53 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-02-09 10:17:53 +0000 |
commit | def947e21fcfb43833a10a4f588b413e2a78bdb4 (patch) | |
tree | 92a6469d8294f168b9846fc71d5b53ba86ed8ab8 /epan/dissectors/packet-sflow.c | |
parent | 9f8841c541cc490f729037d24d936aa1bb5591b4 (diff) |
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
Diffstat (limited to 'epan/dissectors/packet-sflow.c')
-rw-r--r-- | epan/dissectors/packet-sflow.c | 2 |
1 files changed, 2 insertions, 0 deletions
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?? */ |