mirror of
https://github.com/netbirdio/FreeBSD-ports.git
synced 2026-05-22 18:42:42 -07:00
sysutils/cdrdao: Fix zero length DMA with ata(4)
Fix zero length DMA transfer attempted failures with the ata(4) driver. This does not seem to affect users of the ahci(4) driver. While here, convert bzero/bcopy to memset/memmove, respectively. PR: 277115 Reported by: Benjamin Jacobs <freebsd@dev.thsi.be>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
PORTNAME= cdrdao
|
||||
DISTVERSION= 1_2_5
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= sysutils audio
|
||||
MASTER_SITES= https://github.com/${PORTNAME}/${PORTNAME}/releases/download/rel_${DISTVERSION}/ \
|
||||
SF/${PORTNAME}/rel_${DISTVERSION}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--- dao/ScsiIf-freebsd-cam.cc.orig 2023-01-25 14:30:35 UTC
|
||||
+++ dao/ScsiIf-freebsd-cam.cc
|
||||
@@ -112,11 +112,11 @@ int ScsiIf::sendCmd(const unsigned char *cmd, int cmdL
|
||||
{
|
||||
int retval;
|
||||
int flags = CAM_DIR_NONE;
|
||||
- u_int8_t * data_ptr;
|
||||
- size_t data_len;
|
||||
+ u_int8_t * data_ptr = NULL;
|
||||
+ size_t data_len = 0;
|
||||
|
||||
- bzero(impl_->ccb, sizeof(union ccb));
|
||||
- bcopy(cmd, &impl_->ccb->csio.cdb_io.cdb_bytes, cmdLen);
|
||||
+ memset(impl_->ccb, 0, sizeof(union ccb));
|
||||
+ memmove(&impl_->ccb->csio.cdb_io.cdb_bytes, cmd, cmdLen);
|
||||
|
||||
if (dataOut && dataOutLen > 0) {
|
||||
data_ptr = (u_int8_t*) dataOut;
|
||||
@@ -176,8 +176,8 @@ int ScsiIf::inquiry()
|
||||
int i;
|
||||
struct scsi_inquiry_data inq_data;
|
||||
|
||||
- bzero(impl_->ccb, sizeof(union ccb));
|
||||
- bzero(&inq_data, sizeof(inq_data));
|
||||
+ memset(impl_->ccb, 0, sizeof(union ccb));
|
||||
+ memset(&inq_data, 0, sizeof(inq_data));
|
||||
|
||||
scsi_inquiry(&impl_->ccb->csio,
|
||||
DEF_RETRY_COUNT,
|
||||
@@ -0,0 +1,11 @@
|
||||
--- trackdb/FormatMp3.cc.orig 2023-02-03 14:46:06 UTC
|
||||
+++ trackdb/FormatMp3.cc
|
||||
@@ -111,7 +111,7 @@ FormatSupport::Status FormatMp3::madInit()
|
||||
|
||||
// Initialize libao for WAV output;
|
||||
ao_sample_format out_format;
|
||||
- bzero(&out_format, sizeof(out_format));
|
||||
+ memset(&out_format, 0, sizeof(out_format));
|
||||
out_format.bits = 16;
|
||||
out_format.rate = 44100;
|
||||
out_format.channels = 2;
|
||||
Reference in New Issue
Block a user