git: 0524b7ffff66 - main - sysutils/mbgtools: Add error checking for copyin() and copyout() calls
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 03 Jan 2024 01:00:55 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/ports/commit/?id=0524b7ffff66cbc220a165480cc553e8d18bdc91 commit 0524b7ffff66cbc220a165480cc553e8d18bdc91 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-01-02 18:07:59 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-01-03 00:59:29 +0000 sysutils/mbgtools: Add error checking for copyin() and copyout() calls This will be required soon, and the previous lack of such error handling was a bug. PR: 275986 Approved by: antoine --- sysutils/mbgtools/Makefile | 1 + sysutils/mbgtools/files/patch-mbglib_common_macioctl.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/sysutils/mbgtools/Makefile b/sysutils/mbgtools/Makefile index c8884cd1f80d..44044a6553c5 100644 --- a/sysutils/mbgtools/Makefile +++ b/sysutils/mbgtools/Makefile @@ -1,5 +1,6 @@ PORTNAME= mbgtools DISTVERSION= fbsd-1.0.0 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= http://www.meinberg.de/download/drivers/ diff --git a/sysutils/mbgtools/files/patch-mbglib_common_macioctl.h b/sysutils/mbgtools/files/patch-mbglib_common_macioctl.h new file mode 100644 index 000000000000..aaf89acfbd48 --- /dev/null +++ b/sysutils/mbgtools/files/patch-mbglib_common_macioctl.h @@ -0,0 +1,17 @@ +--- mbglib/common/macioctl.h.orig 2024-01-02 18:05:57 UTC ++++ mbglib/common/macioctl.h +@@ -259,10 +259,12 @@ typedef struct + memcpy( _piob, _pin, _size ) + + #define _frc_iob_to_pout( _piob, _pout, _size ) \ +- copyout( _piob, _pout, _size ) ++ if (copyout( _piob, _pout, _size ) != 0) \ ++ goto err_inval + + #define _frc_iob_from_pin( _piob, _pin, _size ) \ +- copyin( _pin, _piob, _size ) ++ if (copyin( _pin, _piob, _size ) != 0) \ ++ goto err_inval + + #define _io_wait_pcps_sec_change( _pddev, _cmd, _type, _pout ) \ + goto err_inval