DCOM: always NUL-terminate dissect_dcom_BSTR results
All of the six users in plugins/epan/profinet/packet-dcom-cba.c expect the string to be NUL-terminated, so ensure this to avoid reading uninitialized memory for the Info column. Bug: 15130 Change-Id: Ibc922068d14b87ce324af3cec22a5f8343088b40 Reviewed-on: https://code.wireshark.org/review/30128 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
f4be16aa45
commit
ec6ace066a
|
@ -1725,8 +1725,10 @@ dissect_dcom_BSTR(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, sub_tree, di, drep,
|
||||
&u32ArraySize);
|
||||
|
||||
if ((guint32)offset + u32ArraySize*2 > G_MAXINT)
|
||||
if ((guint32)offset + u32ArraySize*2 > G_MAXINT) {
|
||||
pszStr[0] = 0;
|
||||
return offset;
|
||||
}
|
||||
|
||||
realOffset = offset + u32ArraySize*2;
|
||||
|
||||
|
|
Loading…
Reference in New Issue