From b4155660f2b60006816de5966d2b1859dc57ff6a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Mon, 28 Mar 2011 14:34:05 +0200 Subject: [PATCH] libudev: make valgrind happy Warning: noted but unhandled ioctl 0x641e with no size/direction hints Syscall param socketcall.setsockopt(optval) points to uninitialised byte(s) at 0x6A30BAA: setsockopt (syscall-template.S:82) by 0x4E36E1C: udev_monitor_filter_update (libudev-monitor.c:347) by 0x4E36ED8: udev_monitor_enable_receiving (libudev-monitor.c:373) by 0x8A9E68E: I830ScreenInit (intel_driver.c:838) by 0x42EE9E: AddScreen (dispatch.c:3890) by 0x471561: InitOutput (xf86Init.c:738) by 0x422C18: main (main.c:205) Location 0x7ff0000c2 is 2 bytes inside local var "filter" declared at libudev-monitor.c:256, in frame #1 of thread 1 Uninitialised value was created by a stack allocation at 0x4E30860: ??? (in /lib64/libudev.so.0.10.0) Thanks to Zdenek Kabelac. --- libudev/libudev-monitor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c index a3789c4d..c97f6faa 100644 --- a/libudev/libudev-monitor.c +++ b/libudev/libudev-monitor.c @@ -342,6 +342,7 @@ int udev_monitor_filter_update(struct udev_monitor *udev_monitor) bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); /* install filter */ + memset(&filter, 0x00, sizeof(filter)); filter.len = i; filter.filter = ins; err = setsockopt(udev_monitor->sock, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter)); -- 2.39.5