summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-03-28 14:34:05 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-03-28 14:34:05 +0200
commitb4155660f2b60006816de5966d2b1859dc57ff6a (patch)
tree6438665b460357e7d3500c341bf4ceaefadea8d3
parent672ff71911f2a42e6af030c3ef8830f51439b0d0 (diff)
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.
-rw-r--r--libudev/libudev-monitor.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c
index a3789c4d13..c97f6faa65 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));