diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-07-01 03:06:44 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-07-01 03:06:44 +0000 |
commit | 241672bb6dfbe3c1c24caad5b6dc595bb19ffd59 (patch) | |
tree | f53da82440a3ad783c77383419a08b19951b8e6c /sys/scsi/scsi_ioctl.c | |
parent | 8ab581762d142299e70da73f2aa0fc7197b7c85d (diff) |
Call malloc(9) with M_ZERO to prevent code paths from exposing
uninitialized memory to user space or devices.
ok deraadt@, dlg@
Diffstat (limited to 'sys/scsi/scsi_ioctl.c')
-rw-r--r-- | sys/scsi/scsi_ioctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c index 1af19624821..611faf70355 100644 --- a/sys/scsi/scsi_ioctl.c +++ b/sys/scsi/scsi_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_ioctl.c,v 1.42 2010/06/15 04:11:34 dlg Exp $ */ +/* $OpenBSD: scsi_ioctl.c,v 1.43 2010/07/01 03:06:43 matthew Exp $ */ /* $NetBSD: scsi_ioctl.c,v 1.23 1996/10/12 23:23:17 christos Exp $ */ /* @@ -114,7 +114,7 @@ scsi_ioc_cmd(struct scsi_link *link, scsireq_t *screq) xs->cmdlen = screq->cmdlen; if (screq->datalen > 0) { - xs->data = malloc(screq->datalen, M_TEMP, M_WAITOK); + xs->data = malloc(screq->datalen, M_TEMP, M_WAITOK | M_ZERO); xs->datalen = screq->datalen; } @@ -223,7 +223,7 @@ scsi_ioc_ata_cmd(struct scsi_link *link, atareq_t *atareq) xs->cmdlen = sizeof(*cdb); if (atareq->datalen > 0) { - xs->data = malloc(atareq->datalen, M_TEMP, M_WAITOK); + xs->data = malloc(atareq->datalen, M_TEMP, M_WAITOK | M_ZERO); xs->datalen = atareq->datalen; } |