diff mbox series

[testsuite,2/2] tests/ioctl: adjust size of variable passed to ioctl(2)

Message ID 20220421081720.744534-3-omosnace@redhat.com (mailing list archive)
State Accepted
Delegated to: Ondrej Mosnáček
Headers show
Series FIOQSIZE followup fixes | expand

Commit Message

Ondrej Mosnacek April 21, 2022, 8:17 a.m. UTC
FIOQSIZE returns a result of type loff_t, which maps to long long int,
so make sure that the variable is large enough to not cause stack
corruption.

Fixes: b11701a55614 ("tests/ioctl: switch to FIOQSIZE")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 tests/ioctl/test_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/ioctl/test_ioctl.c b/tests/ioctl/test_ioctl.c
index 6fff2d0..9bf732d 100644
--- a/tests/ioctl/test_ioctl.c
+++ b/tests/ioctl/test_ioctl.c
@@ -18,7 +18,7 @@  int main(int argc, char **argv)
 
 	int fd;
 	int rc;
-	int val = 0;
+	long long int val = 0;
 
 	fd = open(argv[1], O_RDONLY, 0);