Bug 34811

Summary: Illegal explicit type conversion from DBusConnection* to DBusServer*
Product: dbus Reporter: Huang, Liang <liang.huang>
Component: coreAssignee: Havoc Pennington <hp>
Status: RESOLVED INVALID QA Contact: John (J5) Palmieri <johnp>
Severity: critical    
Priority: high CC: liang.huang
Version: 1.4.xKeywords: NEEDINFO
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: This file compares the two structs mentioned.

Description Huang, Liang 2011-02-27 18:51:51 UTC
In the function "_dbus_connection_remove_watch_unlocked", the first param "connection" type is DBusConnection*.
And then it is passed to the first param "server" of the function "protected_change_watch", but this param has a DBusServer* type.

After explicit type conversion from DBusConnection* to DBusServer*, we will found the pointer DBusServer::watches now points to the address to which DBusConnection::transport points. But this pointer ought to point to the address to which DBusConnection::watches points.

I copied their definition into the attachment.
Comment 1 Huang, Liang 2011-02-27 19:01:56 UTC
Created attachment 43909 [details]
This file compares the two structs mentioned.
Comment 2 Simon McVittie 2011-02-28 06:22:11 UTC
DBusConnection and DBusServer each has a static function called protected_change_watch; they are not the same (and each is only visible in its own translation unit).

Unless you have a concrete example of code that can call the wrong one (I'm not sure how that could even happen), I think this should be RESOLVED INVALID.
Comment 3 Huang, Liang 2011-02-28 17:14:27 UTC
Yeah, you are right, it is not a bug.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.