summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2018-03-13 12:48:52 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2018-03-13 13:16:22 +0900
commit7e1da0f164fd6eaa62947d266bce7e3c933f98fb (patch)
treed25bff5a202881cddf19e836d63bbbbaa2beb89a
parent17df2da270de7c6a30106184b4e6fb2aec187cab (diff)
downloadlibdrm-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.c2
-rw-r--r--tests/rottest/rotator.c2
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;