diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-12-02 15:10:28 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-12-02 15:10:28 +0000 |
commit | c26d0c2b5b84c9394ea27d11fe682b7d667afb39 (patch) | |
tree | e636397bb881f46ffe7f72cd9b90a25878a430a9 /sys | |
parent | 9de5a46d50a6cc743f04501b90716eb48bf1cfbb (diff) |
Don't forget the scsi_vpd_header when calculating the number of bytes
obtained by scsi_inquire_vpd().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/scsi/scsi_base.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 955c32e9e73..afec7caabe2 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.250 2019/12/01 16:56:26 krw Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.251 2019/12/02 15:10:27 krw Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -907,7 +907,8 @@ scsi_inquire_vpd(struct scsi_link *link, void *buf, u_int buflen, #ifdef SCSIDEBUG sc_print_addr(link); if (error == 0) { - bytes = _2btol(((struct scsi_vpd_hdr *)buf)->page_length); + bytes = sizeof(struct scsi_vpd_hdr) + + _2btol(((struct scsi_vpd_hdr *)buf)->page_length); printf("got %u of %u bytes of VPD inquiry page %u data:\n", buflen, bytes, page); scsi_show_mem(buf, buflen); |