summaryrefslogtreecommitdiff
path: root/packet-dcerpc-nt.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-01-07 19:55:48 +0000
committerGuy Harris <guy@alum.mit.edu>2002-01-07 19:55:48 +0000
commitf13c5b21541c09f1dbc626c7c7a6835d4b133bfe (patch)
treedf01966627ec1cdb8799cba7a19a4def952ac2c0 /packet-dcerpc-nt.c
parente35851244c1dafdcad42cc1d81819836a01c33e1 (diff)
downloadwireshark-f13c5b21541c09f1dbc626c7c7a6835d4b133bfe.tar.gz
Updates from Tim Potter.
svn path=/trunk/; revision=4493
Diffstat (limited to 'packet-dcerpc-nt.c')
-rw-r--r--packet-dcerpc-nt.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/packet-dcerpc-nt.c b/packet-dcerpc-nt.c
index 5fe5aeb242..ec3124c2a1 100644
--- a/packet-dcerpc-nt.c
+++ b/packet-dcerpc-nt.c
@@ -2,7 +2,7 @@
* Routines for DCERPC over SMB packet disassembly
* Copyright 2001, Tim Potter <tpot@samba.org>
*
- * $Id: packet-dcerpc-nt.c,v 1.2 2002/01/03 20:42:40 guy Exp $
+ * $Id: packet-dcerpc-nt.c,v 1.3 2002/01/07 19:55:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -75,6 +75,11 @@ int prs_uint8s(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
const guint8 *ptr;
+ /* The tvb_get_ptr() function fails an assertion if count < -1 */
+
+ if (count < -1)
+ THROW(BoundsError);
+
/* No alignment required */
ptr = tvb_get_ptr(tvb, offset, count);
@@ -118,6 +123,11 @@ int prs_uint16s(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
const guint8 *ptr;
+ /* The tvb_get_ptr() function fails an assertion if count < -1 */
+
+ if (count < -1)
+ THROW(BoundsError);
+
offset = prs_align(offset, 2);
ptr = tvb_get_ptr(tvb, offset, count * 2);
@@ -162,6 +172,11 @@ int prs_uint32s(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
const guint8 *ptr;
+ /* The tvb_get_ptr() function fails an assertion if count < -1 */
+
+ if (count < -1)
+ THROW(BoundsError);
+
offset = prs_align(offset, 4);
ptr = tvb_get_ptr(tvb, offset, count * 4);