Bug 34811 - Illegal explicit type conversion from DBusConnection* to DBusServer*
Summary: Illegal explicit type conversion from DBusConnection* to DBusServer*
Status: RESOLVED INVALID
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.4.x
Hardware: All Linux (All)
: high critical
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2011-02-27 18:51 UTC by Huang, Liang
Modified: 2011-02-28 23:33 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
This file compares the two structs mentioned. (6.24 KB, text/x-csrc)
2011-02-27 19:01 UTC, Huang, Liang
Details

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.