From b5d61c86ab23baf420764cbcc4814aee42d34a9d Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Tue, 16 Jun 2020 18:23:43 +0900 Subject: v4l2: v4l2_camera_proxy: Check for null arg values in main ioctl handler The ioctl handlers currently don't check if arg is null, so if it ever is, it will cause a segfault. Check that arg is null and return -EFAULT in the main vidioc ioctl handler. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/v4l2/v4l2_camera_proxy.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/v4l2/v4l2_camera_proxy.h') diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h index 36d1dbc8..86c1a7df 100644 --- a/src/v4l2/v4l2_camera_proxy.h +++ b/src/v4l2/v4l2_camera_proxy.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +69,8 @@ private: static PixelFormat v4l2ToDrm(uint32_t format); static uint32_t drmToV4L2(const PixelFormat &format); + static const std::set supportedIoctls_; + unsigned int refcount_; unsigned int index_; -- cgit v1.2.1