summaryrefslogtreecommitdiffstats
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2019-12-02 17:53:05 +0000
committerkrw <krw@openbsd.org>2019-12-02 17:53:05 +0000
commitc340ff0997dc0a6fdaa972efd58bed26b31ef0bf (patch)
tree4edfad520529592da6fddd9dad1601f39c56ab5f /sys/scsi/scsi_base.c
parentIt is not always clear what ld.so was backed up to ld.so.backup, and (diff)
downloadwireguard-openbsd-c340ff0997dc0a6fdaa972efd58bed26b31ef0bf.tar.xz
wireguard-openbsd-c340ff0997dc0a6fdaa972efd58bed26b31ef0bf.zip
Have SCSIDEBUG show the number of bytes of VPD inquiry data received,
not the number of bytes that were available in the buffer.
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index afec7caabe2..808c7df03d8 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.251 2019/12/02 15:10:27 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.252 2019/12/02 17:53:05 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -909,6 +909,8 @@ scsi_inquire_vpd(struct scsi_link *link, void *buf, u_int buflen,
if (error == 0) {
bytes = sizeof(struct scsi_vpd_hdr) +
_2btol(((struct scsi_vpd_hdr *)buf)->page_length);
+ if (bytes < buflen)
+ buflen = bytes;
printf("got %u of %u bytes of VPD inquiry page %u data:\n", buflen,
bytes, page);
scsi_show_mem(buf, buflen);