aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-06-13 07:36:52 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-06-13 07:36:52 +0000
commitc30c592173db4b8a34ad20a9ce0453349e18dbd0 (patch)
treeb0f18dc4137554f68e80842b41b42d7667534f49
parentdb48213521bd1c752c3262fec8a44c8170a974db (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'). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5665 f5534014-38df-0310-8fa8-9805f1628bb7
-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;