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> | 2018-03-13 13:16:22 +0900 |
commit | 7e1da0f164fd6eaa62947d266bce7e3c933f98fb (patch) | |
tree | d25bff5a202881cddf19e836d63bbbbaa2beb89a | |
parent | 17df2da270de7c6a30106184b4e6fb2aec187cab (diff) | |
download | libdrm-7e1da0f164fd6eaa62947d266bce7e3c933f98fb.tar.gz libdrm-7e1da0f164fd6eaa62947d266bce7e3c933f98fb.tar.bz2 libdrm-7e1da0f164fd6eaa62947d266bce7e3c933f98fb.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 fbc3734f..a16b7b17 100644 --- a/tests/ipptest/fimc.c +++ b/tests/ipptest/fimc.c @@ -621,7 +621,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 f3bed0f6..b7cb7ab1 100644 --- a/tests/rottest/rotator.c +++ b/tests/rottest/rotator.c @@ -186,7 +186,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; |