aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-06-01 19:19:40 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-06-01 19:19:40 +0000
commit46ff66522f094c26b8052af199f6e7131834b530 (patch)
tree15072c2c184f7916454f2c3528d3eb4f814b0d3c /epan
parentbb4e980df1566b2545471c4ffcdc49329cc070d2 (diff)
prevent "Dissector Bug": prevent a string processing of length 0
svn path=/trunk/; revision=14516
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-dcom.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c
index 8b19cfa096..23e8e65565 100644
--- a/epan/dissectors/packet-dcom.c
+++ b/epan/dissectors/packet-dcom.c
@@ -1249,13 +1249,18 @@ dissect_dcom_indexed_LPWSTR(tvbuff_t *tvb, gint offset, packet_info *pinfo,
offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, sub_tree, drep,
&u32ArraySize);
+ DISSECTOR_ASSERT(u32MaxStr != 0);
u32ArraySize++; /* u32MaxStr is including zero termination */
if (u32ArraySize < u32MaxStr) {
u32MaxStr = u32ArraySize;
}
u32StrStart = offset;
- offset = dcom_tvb_get_nwstringz0(tvb, offset, u32MaxStr, pszStr);
+ if(u32MaxStr != 0) {
+ offset = dcom_tvb_get_nwstringz0(tvb, offset, u32MaxStr, pszStr);
+ } else {
+ strcpy(pszStr, "");
+ }
#if GLIB_MAJOR_VERSION < 2
pszEscaped = g_strescape(pszStr);