diff options
author | Uli Heilmeier <uh@heilmeier.eu> | 2020-05-14 23:16:05 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-05-15 07:33:35 +0000 |
commit | b5dc967c7924a3bd4326099c2939f3bb068a1c35 (patch) | |
tree | 30b60a73a57d02a04dda6919b782f3468ab6c398 /epan/dissectors/packet-radius.c | |
parent | 6078965ebe5ba2c9956651d97a6b0b451ab3a191 (diff) |
Radius: Fix NULL pointer call
Check length before calling tvb_bytes_to_str()
Bug: 16564
Change-Id: I3cfb91d5da5f6f620f8f48c55fb3837ebe70972c
Reviewed-on: https://code.wireshark.org/review/37200
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-radius.c')
-rw-r--r-- | epan/dissectors/packet-radius.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index 1390c6e812..4be50cac1f 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -1095,6 +1095,11 @@ radius_string(radius_attr_info_t *a, proto_tree *tree, packet_info *pinfo _U_, t void radius_octets(radius_attr_info_t *a, proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset, int len, proto_item *avp_item) { + if (len == 0) { + proto_item_append_text(avp_item, "[wrong length]"); + return; + } + proto_tree_add_item(tree, a->hf, tvb, offset, len, ENC_NA); proto_item_append_text(avp_item, "%s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, len)); } |