potential error in DBus code?
dcbw at redhat.com
Wed Dec 8 19:02:46 EST 2010
On Wed, 2010-12-08 at 11:56 +0100, Johannes Berg wrote:
> On Wed, 2010-12-08 at 11:27 +0100, Johannes Berg wrote:
> > I'm a little confused now. We have this code:
> > wpa_dbus_dict_begin_string_array:
> > if (!dbus_message_iter_open_container(iter_dict_entry,
> > DBUS_TYPE_VARIANT,
> > DBUS_TYPE_ARRAY_AS_STRING
> > DBUS_TYPE_STRING_AS_STRING,
> > iter_dict_val))
> > return FALSE;
> > if (!dbus_message_iter_open_container(iter_dict_val, DBUS_TYPE_ARRAY,
> > DBUS_TYPE_BYTE_AS_STRING,
> > iter_array))
> > and then
> > wpa_dbus_dict_string_array_add_element:
> > return dbus_message_iter_append_basic(iter_array, DBUS_TYPE_STRING,
> > &elem);
> > Shouldn't the DBUS_TYPE_BYTE_AS_STRING above be
> > DBUS_TYPE_STRING_AS_STRING to match the array contents? I can trace this
> > code all the way back to a commit from 2006 from Dan...
> FWIW, nothing seems to happen in dbus-send/d-feet when I change it ...
Yeah, that does look like the wrong type there, probably C & P error.
Odd that it works, though the fact that it's using the right type in the
first iter open may save us.
More information about the HostAP