From f7b6ebcc042f114a4b89aae3df9955d380d2133a Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Tue, 18 Jan 2022 11:43:08 +0100 Subject: tvbuff: assert the called len is > 0. This assert will notify the higher layers that the dissector needs to be fixed. ieee1722 and zbee-zcl dissectors have been updated to prevent such a call. Ref: #17882. --- epan/tvbuff.c | 1 + 1 file changed, 1 insertion(+) (limited to 'epan/tvbuff.c') diff --git a/epan/tvbuff.c b/epan/tvbuff.c index bcf8a183ca..5dab307577 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -4318,6 +4318,7 @@ int tvb_get_token_len(tvbuff_t *tvb, const gint offset, int len, gint *next_offs gchar * tvb_bytes_to_str_punct(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint len, const gchar punct) { + DISSECTOR_ASSERT(len > 0); return bytes_to_str_punct(scope, ensure_contiguous(tvb, offset, len), len, punct); } -- cgit v1.2.3