forked from osmocom/wireshark
mount: don't THROW() an exception from a dissector
if the length is too large, we can simply skip nfs_name_snoop_add_name() and the code to prepare its input Change-Id: I30c9a89edf7b48c45b52e7dad099ac4151f7f4a7 Reviewed-on: https://code.wireshark.org/review/15883 Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
238a9846bc
commit
048ba7a3a3
|
@ -169,19 +169,18 @@ dissect_mount_dirpath_call(tvbuff_t *tvb, packet_info *pinfo,
|
|||
|
||||
host=address_to_str(wmem_packet_scope(), &pinfo->dst);
|
||||
len=tvb_get_ntohl(tvb, offset);
|
||||
if (len >= ITEM_LABEL_LENGTH)
|
||||
THROW(ReportedBoundsError);
|
||||
if (len < ITEM_LABEL_LENGTH) {
|
||||
name=(unsigned char *)g_malloc(strlen(host)+1+len+1+200);
|
||||
ptr=name;
|
||||
memcpy(ptr, host, strlen(host));
|
||||
ptr+=strlen(host);
|
||||
*ptr++=':';
|
||||
tvb_memcpy(tvb, ptr, offset+4, len);
|
||||
ptr+=len;
|
||||
*ptr=0;
|
||||
|
||||
name=(unsigned char *)g_malloc(strlen(host)+1+len+1+200);
|
||||
ptr=name;
|
||||
memcpy(ptr, host, strlen(host));
|
||||
ptr+=strlen(host);
|
||||
*ptr++=':';
|
||||
tvb_memcpy(tvb, ptr, offset+4, len);
|
||||
ptr+=len;
|
||||
*ptr=0;
|
||||
|
||||
nfs_name_snoop_add_name(civ->xid, tvb, -1, (gint)strlen(name), 0, 0, name);
|
||||
nfs_name_snoop_add_name(civ->xid, tvb, -1, (gint)strlen(name), 0, 0, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue