From 052b4f2969aa9d9d9adf63cf0d1ec40472eb5038 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Tue, 12 Mar 2019 14:20:37 +0100 Subject: [PATCH] SDL_EVDEV_kbd_init: uninitialized data for ioctl (Bug 4530) Only two chars are used but the full prototype is: int tioclinux(struct tty_struct *tty, unsigned long arg) ==5010== Syscall param ioctl(TIOCLINUX) points to uninitialised byte(s) ==5010== at 0x53E73C7: ioctl (syscall-template.S:78) ==5010== by 0x4A887DA: SDL_EVDEV_Init (SDL_evdev.c:163) ==5010== by 0x4A7D157: KMSDRM_VideoInit (SDL_kmsdrmvideo.c:509) ==5010== by 0x497D959: SDL_VideoInit_REAL (SDL_video.c:529) ==5010== by 0x487ACBC: SDL_InitSubSystem_REAL (SDL.c:171) ==5010== by 0x487B052: SDL_Init_REAL (SDL.c:256) ==5010== by 0x488F7D6: SDL_Init (SDL_dynapi_procs.h:85) --- src/core/linux/SDL_evdev_kbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/linux/SDL_evdev_kbd.c b/src/core/linux/SDL_evdev_kbd.c index 6e2e8d578..208ab685e 100644 --- a/src/core/linux/SDL_evdev_kbd.c +++ b/src/core/linux/SDL_evdev_kbd.c @@ -345,7 +345,7 @@ SDL_EVDEV_kbd_init(void) SDL_EVDEV_keyboard_state *kbd; int i; char flag_state; - char shift_state[2] = {TIOCL_GETSHIFTSTATE, 0}; + char shift_state[ sizeof (long) ] = {TIOCL_GETSHIFTSTATE, 0}; kbd = (SDL_EVDEV_keyboard_state *)SDL_calloc(1, sizeof(*kbd)); if (!kbd) {