aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2015-05-13 17:54:19 +0200
committerAnders Broman <a.broman58@gmail.com>2015-05-13 15:59:09 +0000
commitcf82e68d58450c4c19d8555e6bc659e1b9d44e57 (patch)
treec40bd570727f31f1090788113bf5721d2099bdf7 /epan
parent46d89bd27f5946dd278ec08e770fea0305d420f0 (diff)
[Thrift] Strengthen the heuristic.
Change-Id: I9e0676f36f8c5cb7fb344640333c8d32990e0a1e Reviewed-on: https://code.wireshark.org/review/8452 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-thrift.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/epan/dissectors/packet-thrift.c b/epan/dissectors/packet-thrift.c
index 76cdeca26c..f575a9c5ef 100644
--- a/epan/dissectors/packet-thrift.c
+++ b/epan/dissectors/packet-thrift.c
@@ -310,10 +310,13 @@ dissect_thrift_heur(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void *d
offset += 4;
str_length = tvb_get_ntohl(tvb, offset);
- if (length < str_length + 8){
+ if ((str_length < 1) ||(length < str_length + 8)){
return FALSE;
}
offset += 4;
+ if (length < offset + str_length){
+ return FALSE;
+ }
while (offset < (str_length + 8)){
c = tvb_get_guint8(tvb, offset);
if (!g_ascii_isprint(c)){