SMB2: prevent calling wmem_array_append() without a valid pointer

This commit is contained in:
Pascal Quantin 2023-11-03 12:47:41 +01:00
parent ce1b766a95
commit d1f64e9cbb
1 changed files with 3 additions and 1 deletions

View File

@ -10434,7 +10434,9 @@ decrypt_smb_payload(packet_info *pinfo,
static void
append_uncompress_data(wmem_array_t *out, tvbuff_t *tvb, int offset, guint length)
{
wmem_array_append(out, tvb_get_ptr(tvb, offset, length), length);
const guint8 *ptr = tvb_get_ptr(tvb, offset, length);
if (ptr)
wmem_array_append(out, tvb_get_ptr(tvb, offset, length), length);
}
static int