aboutsummaryrefslogtreecommitdiffstats
path: root/packet-beep.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-06-13 07:32:34 +0000
committerGuy Harris <guy@alum.mit.edu>2002-06-13 07:32:34 +0000
commitbe4fc3120a94995f2b27ac0ecb50a3ecaa711199 (patch)
tree51352e0c4fc210f2a37931e54598422f87558668 /packet-beep.c
parent1fdab024c081efd0df698ac326fedf7fd269565f (diff)
From Peter Hawkins: fix the maximum length argument to "tvb_memcpy()".
svn path=/trunk/; revision=5664
Diffstat (limited to 'packet-beep.c')
-rw-r--r--packet-beep.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/packet-beep.c b/packet-beep.c
index 24457b4ebf..7693cb9e3b 100644
--- a/packet-beep.c
+++ b/packet-beep.c
@@ -1,7 +1,7 @@
/* packet-beep.c
* Routines for BEEP packet disassembly
*
- * $Id: packet-beep.c,v 1.8 2002/04/29 09:40:05 guy Exp $
+ * $Id: packet-beep.c,v 1.9 2002/06/13 07:32:32 guy Exp $
*
* Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com>
* Modified 2001 Darren New <dnew@invisible.net> for BEEP.
@@ -470,9 +470,11 @@ dissect_beep_int(tvbuff_t *tvb, int offset,
memset(int_buff, '\0', sizeof(int_buff));
- tvb_memcpy(tvb, int_buff, offset, MIN(sizeof(int_buff), i));
+ tvb_memcpy(tvb, int_buff, offset, MIN(sizeof(int_buff) - 1, i));
- sscanf(int_buff, "%d", &ival); /* FIXME: Dangerous */
+ /* XXX - is this still "Dangerous" now that we don't copy to the
+ last byte of "int_buff[]"? */
+ sscanf(int_buff, "%d", &ival);
if (tree) {
proto_tree_add_uint(tree, hf, tvb, offset, i, ival);