Skip to contentSkip to conversation

tests/drm_read: Fix subtest invalid-buffer

RFC PATCH In review Vidya Srinivas 1 participant 1 message May 27, 2021

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/4 tests/drm_read: Fix subtest invalid-buffer

Using (void *)-1 directly in read is aborting on chrome systems. Following message is seen.

Starting subtest: invalid-buffer
*** buffer overflow detected ***: terminated
Received signal SIGABRT.
Stack trace:
Aborted (core dumped)

Patch just adds a pointer variable and uses it in read.

Change-Id I97f129e586bf9212eb0a63a4cd4c91e0327dd550
---
 tests/drm_read.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/drm_read.c +2 -1
index ccf9d822fd8d..2fdec5be4078 100644
@@ -103,10 +103,11 @@ static void teardown(int fd)
 static void test_invalid_buffer(int in)
 {
 	int fd = setup(in, 0);
+	void *add = (void *)-1;
 
 	alarm(1);
 
-	igt_assert_eq(read(fd, (void *)-1, 4096), -1);
+	igt_assert_eq(read(fd, add, 4096), -1);
 	igt_assert_eq(errno, EFAULT);
 
 	teardown(fd);
Signature · 6 lines
2.26.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx