diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2018-03-13 12:48:52 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2020-02-24 10:53:37 +0900 |
commit | 2c8d082c5d71a66781863c942a292cf68262fd4d (patch) | |
tree | 858b75e5ec227c9aede6ce606e099f9ce38d9c1d | |
parent | d1aad9d45d31c85aa1b2a4b7edc85558bf1d1705 (diff) | |
download | libdrm-2c8d082c5d71a66781863c942a292cf68262fd4d.tar.gz libdrm-2c8d082c5d71a66781863c942a292cf68262fd4d.tar.bz2 libdrm-2c8d082c5d71a66781863c942a292cf68262fd4d.zip |
ipptest: fix possibility for out of array bounds
Fix to possibility for out of array bounds with checking maximum
size of array before using it.
Change-Id: Icb3cde47801ae3e4f3e395bff0d6212b6f8e69aa
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r-- | tests/ipptest/fimc.c | 2 | ||||
-rw-r--r-- | tests/rottest/rotator.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/ipptest/fimc.c b/tests/ipptest/fimc.c index 845fb8ee..6970af64 100644 --- a/tests/ipptest/fimc.c +++ b/tests/ipptest/fimc.c @@ -617,7 +617,7 @@ int fimc_event_handler(struct drm_exynos_ipp_queue_buf *src_qbuf, len = read(fd, buffer, sizeof(buffer)); if (len == 0) return 0; - if (len < sizeof(*e)) + if (len < sizeof(*e) || len > 1024) return -1; i = 0; diff --git a/tests/rottest/rotator.c b/tests/rottest/rotator.c index 2f2d97a1..61beaddb 100644 --- a/tests/rottest/rotator.c +++ b/tests/rottest/rotator.c @@ -182,7 +182,7 @@ static int rotator_event_handler(int fd, int idx, int prop_id, len = read(fd, buffer, sizeof(buffer)); if (!len) return 0; - if (len < sizeof (*e)) + if (len < sizeof (*e) || len > 1024) return -1; i = 0; |