Valgrind reports with D-Bus API

Jouni Malinen j at w1.fi
Wed Jan 6 05:01:00 EST 2010


On Tue, Jan 05, 2010 at 06:43:11PM -0800, Marcel Holtmann wrote:

> so when running wpa_supplicant via valgrind, I get a lot of annoying
> reports like this:
> 
> ==25940== Invalid write of size 1
> ==25940==    at 0x43C30E: send_prop_changed_signal (dbus_new_helpers.c:622)

> ==25940==  Address 0x4cbd191 is 0 bytes after a block of size 1 alloc'd
> ==25940==    by 0x43D3A5: wpas_dbus_register (dbus_new.c:817)

Fixed.. Extraneous semicolons can be dangerous:


--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -757,7 +757,7 @@ static void wpas_dbus_register(struct wpa_dbus_object_desc *obj_desc,
 	obj_desc->properties = properties;
 	obj_desc->signals = signals;
 
-	for (n = 0; properties && properties->dbus_property; properties++);
+	for (n = 0; properties && properties->dbus_property; properties++)
 		n++;
 
 	obj_desc->prop_changed_flags = os_zalloc(n);

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list