From 11b345df8dd8063507784373b4d48821ffaacbe2 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 21 Jun 2010 13:47:11 +0000 Subject: avoid an overflow of the xs sense buffer by ignoring t2i->senselen. again, found by and fixed by matthew dempsky. --- sys/dev/vscsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index 1a3e37317d3..566beebdda6 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.11 2010/06/21 13:28:09 dlg Exp $ */ +/* $OpenBSD: vscsi.c,v 1.12 2010/06/21 13:47:10 dlg Exp $ */ /* * Copyright (c) 2008 David Gwynne @@ -397,7 +397,7 @@ vscsi_t2i(struct vscsi_softc *sc, struct vscsi_ioc_t2i *t2i) break; case VSCSI_STAT_SENSE: xs->error = XS_SENSE; - bcopy(&t2i->sense, &xs->sense, t2i->senselen); + bcopy(&t2i->sense, &xs->sense, sizeof(xs->sense)); xs->req_sense_length = t2i->senselen; break; case VSCSI_STAT_ERR: -- cgit v1.2.3