aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-04-04 21:44:53 +0000
committerGerald Combs <gerald@wireshark.org>2005-04-04 21:44:53 +0000
commitb170e98255ea3e6027a7ffda49bd1b3236cd32de (patch)
tree65905cf0a10941cf9c09790d439af7fbfe18b5a7
parent79b30e6df5fa9771a6241a11bb218ab48e58c2fc (diff)
Add length checks so that we don't overflow buffers.
svn path=/trunk/; revision=14016
-rw-r--r--epan/dissectors/packet-distcc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/dissectors/packet-distcc.c b/epan/dissectors/packet-distcc.c
index 2bf7449b23..6d73d6b2d2 100644
--- a/epan/dissectors/packet-distcc.c
+++ b/epan/dissectors/packet-distcc.c
@@ -68,12 +68,13 @@ static guint glb_distcc_tcp_port = TCP_PORT_DISTCC;
extern void proto_reg_handoff_distcc(void);
#define CHECK_PDU_LEN(x) \
- if(parameter>tvb_length_remaining(tvb, offset)){\
+ if(parameter>tvb_length_remaining(tvb, offset) || parameter < 1){\
len=tvb_length_remaining(tvb, offset);\
if (check_col(pinfo->cinfo, COL_INFO)) {\
col_append_fstr(pinfo->cinfo, COL_INFO, "[Short" x " PDU]");\
}\
- }
+ } \
+ tvb_ensure_bytes_exist(tvb, offset, len);
#define DESEGMENT_TCP(x) \