diff options
author | AndersBroman <anders.broman@ericsson.com> | 2015-05-13 17:54:19 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-05-13 15:59:09 +0000 |
commit | cf82e68d58450c4c19d8555e6bc659e1b9d44e57 (patch) | |
tree | c40bd570727f31f1090788113bf5721d2099bdf7 /epan/dissectors/packet-thrift.c | |
parent | 46d89bd27f5946dd278ec08e770fea0305d420f0 (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/dissectors/packet-thrift.c')
-rw-r--r-- | epan/dissectors/packet-thrift.c | 5 |
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)){ |