From 0524b7ffff66cbc220a165480cc553e8d18bdc91 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 2 Jan 2024 13:07:59 -0500 Subject: 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/files/patch-mbglib_common_macioctl.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sysutils/mbgtools/files/patch-mbglib_common_macioctl.h (limited to 'sysutils/mbgtools/files/patch-mbglib_common_macioctl.h') 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 -- cgit v1.2.3