From 64edeaaa4c7492d090b4069de2eae5f411ff1cd4 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Sat, 16 Mar 2024 13:07:19 +0100 Subject: Fix read from uninitialized data Syscall param writev(vector[0]) points to uninitialised byte(s) at 0x4B836C0: writev (writev.c:26) by 0x4C74FBF: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0) by 0x4C753B0: xcb_writev (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0) by 0x48B2A24: _XSend (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) by 0x48B3088: _XReply (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) by 0x48AE6FE: XSync (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) by 0x11C523: HandleEnterNotify (events.c:2112) by 0x117847: DispatchEvent (events.c:335) by 0x117921: HandleEvents (events.c:363) by 0x12FCBD: main (twm.c:648) Address 0x5036874 is 148 bytes inside a block of size 16,384 alloc'd at 0x48459F3: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x48A23AA: XOpenDisplay (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) by 0x49E5A12: XtOpenDisplay (in /usr/lib/x86_64-linux-gnu/libXt.so.6.0.0) by 0x12EB45: main (twm.c:319) Uninitialised value was created by a stack allocation at 0x12828E: send_clientmessage (menus.c:2861) Signed-off-by: Tim Wiederhake Part-of: --- src/menus.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/menus.c b/src/menus.c index 41f5bad..7814771 100644 --- a/src/menus.c +++ b/src/menus.c @@ -2860,6 +2860,7 @@ static void send_clientmessage(Window w, Atom a, Time timestamp) { XClientMessageEvent ev; + memset(&ev, '\0', sizeof(ev)); ev.type = ClientMessage; ev.window = w; -- cgit v1.2.3