diff options
author | Moritz Jodeit <moritz@cvs.openbsd.org> | 2005-04-28 10:16:05 +0000 |
---|---|---|
committer | Moritz Jodeit <moritz@cvs.openbsd.org> | 2005-04-28 10:16:05 +0000 |
commit | c03673c973f7237b76ad78761d9af76d16e1746e (patch) | |
tree | c0c3931d5b37f7a35fb8911d2f0d3bb174ea3725 /sys/scsi | |
parent | 0af93708eb0ddbbcc2e47b8102dd89ac558aced8 (diff) |
more snprintf error checking. ok krw@
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/scsi_base.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 3df654f309d..4797fd56209 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.66 2005/04/17 18:55:45 tom Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.67 2005/04/28 10:16:04 moritz Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -1567,7 +1567,7 @@ scsi_decode_sense(sense, flag) "Error in %s, Offset %d", (spec_1 & SSD_SCS_CDB_ERROR) ? "CDB" : "Parameters", count); - if ((len < sizeof rqsbuf) && + if ((len != -1 && len < sizeof rqsbuf) && (spec_1 & SSD_SCS_VALID_BIT_INDEX)) snprintf(rqsbuf+len, sizeof rqsbuf - len, ", bit %d", spec_1 & SSD_SCS_BIT_INDEX); |