aboutsummaryrefslogtreecommitdiffstats
path: root/packet-scsi.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-06-13 07:36:52 +0000
committerGuy Harris <guy@alum.mit.edu>2002-06-13 07:36:52 +0000
commitb412b99609d5be744e1fc32b34e79e9dc14251cb (patch)
treeb0f18dc4137554f68e80842b41b42d7667534f49 /packet-scsi.c
parentbe4fc3120a94995f2b27ac0ecb50a3ecaa711199 (diff)
From Peter Hawkins: make the maximum length argument to
"tvb_get_nstringz0()" no larger than the space in "str" (not counting the space for the trailing '\0'). Make "str" big enough to hold a maximum-length serial number string (the length is 1 byte, hence the maximum length is 256 bytes plus 1 byte of terminating '\0'). svn path=/trunk/; revision=5665
Diffstat (limited to 'packet-scsi.c')
-rw-r--r--packet-scsi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/packet-scsi.c b/packet-scsi.c
index f16d80f3dc..9a78a4e895 100644
--- a/packet-scsi.c
+++ b/packet-scsi.c
@@ -2,7 +2,7 @@
* Routines for decoding SCSI CDBs and responses
* Author: Dinesh G Dutt (ddutt@cisco.com)
*
- * $Id: packet-scsi.c,v 1.9 2002/04/14 23:04:04 guy Exp $
+ * $Id: packet-scsi.c,v 1.10 2002/06/13 07:36:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1279,7 +1279,7 @@ dissect_scsi_evpd (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
proto_item *ti;
guint pcode, plen, i, idlen;
guint8 flags;
- char str[32];
+ char str[256+1];
if (tree) {
pcode = tvb_get_guint8 (tvb, offset+1);
@@ -1343,7 +1343,7 @@ dissect_scsi_evpd (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
break;
case SCSI_EVPD_DEVSERNUM:
str[0] = '\0';
- tvb_get_nstringz0 (tvb, offset, plen, str);
+ tvb_get_nstringz0 (tvb, offset, MIN(plen, sizeof(str) - 1), str);
proto_tree_add_text (evpd_tree, tvb, offset, plen,
"Product Serial Number: %s", str);
break;