diff options
author | Mark Johnston <markj@FreeBSD.org> | 2024-01-02 13:07:59 -0500 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2024-01-02 19:59:29 -0500 |
commit | 0524b7ffff66cbc220a165480cc553e8d18bdc91 (patch) | |
tree | 1b0142ed4aceb764176f4c5a70167f29ffc8c053 /sysutils/mbgtools/files/patch-mbglib_common_macioctl.h | |
parent | net-im/telegram-desktop: update 4.14.1 -> 4.14.2 (+) (diff) |
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
Diffstat (limited to 'sysutils/mbgtools/files/patch-mbglib_common_macioctl.h')
-rw-r--r-- | sysutils/mbgtools/files/patch-mbglib_common_macioctl.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 |