[pulseaudio-discuss] [PATCH 1/2] bluetooth: Fix potential NULL pointer dereference

Peter Meerwald-Stadler pmeerw at pmeerw.net
Wed Aug 17 13:23:03 UTC 2016


> On Wed, 2016-08-17 at 14:43 +0200, Peter Meerwald-Stadler wrote:
> > I can't find an easy argument why the NULL dereference can't happen (as I 
> > am not intimate with the semantics of the dbus functions involved)
> 
> Sorry, I should have provided an explanation already in my previous
> mail.

will add that to the commit message, thanks!
 
> > why is d always != NULL when 
> > dbus_message_is_method_call(p->message, "org.bluez.Device",
> > "GetProperties") != 0?
> 
> Because of this part:
> 
>     if (dbus_message_has_interface(p->message, "org.bluez.Manager") ||
>         dbus_message_has_interface(p->message, "org.bluez.Adapter"))
>         d = NULL;
>     else if (!(d = pa_hashmap_get(y->devices, dbus_message_get_path(p->message)))) {
>         pa_log_warn("Received GetProperties() reply from unknown device: %s (device removed?)", dbus_message_get_path(p->message));
>         goto finish2;
>     }
> 
> d can be NULL only if p->message interface is org.bluez.Manager or
> org.bluez.Adapter. If
> 
>     dbus_message_is_method_call(p->message, "org.bluez.Device", "GetProperties")
> 
> returns true, we know that the interface is org.bluez.Device.
> 
> -- 
> Tanu
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
> 

-- 

Peter Meerwald-Stadler
+43-664-2444418 (mobile)


More information about the pulseaudio-discuss mailing list