Bug 22141 - dbus_message_marshal() can produce invalid messages.
Summary: dbus_message_marshal() can produce invalid messages.
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL: http://git.collabora.co.uk/?p=user/wj...
Whiteboard:
Keywords:
Depends on:
Blocks: 19723
  Show dependency treegraph
 
Reported: 2009-06-07 09:57 UTC by Will Thompson
Modified: 2009-07-10 16:48 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Ensure messages are locked while marshalling. (1.55 KB, patch)
2009-06-07 09:57 UTC, Will Thompson
Details | Splinter Review
A better patch that doesn't erroneously leave the message locked (1.63 KB, patch)
2009-06-07 11:00 UTC, Will Thompson
Details | Splinter Review

Description Will Thompson 2009-06-07 09:57:42 UTC
Created attachment 26513 [details] [review]
Ensure messages are locked while marshalling.

While exposing marshal() and demarshal() in the Python binding, Ben Schwartz found that the former produces messages that the latter rejects. This turns out to be because the length header is wrong.

The attached patch (also available at <http://git.collabora.co.uk/?p=user/wjt/dbus.git;a=shortlog;h=refs/heads/fill-in-length-before-marshalling>) attempts to fix this by ensuring the message is locked while it's being marshalled. I haven't tested it, mind; perhaps a regression test would be a good idea.
Comment 1 Will Thompson 2009-06-07 11:00:19 UTC
Created attachment 26514 [details] [review]
A better patch that doesn't erroneously leave the message locked

Ben noticed that my original patch left the message locked if _dbus_string_init () failed. I've updated the branch accordingly.
Comment 2 Thiago Macieira 2009-06-15 16:22:19 UTC
Patch looks OK. Recommend committing it.
Comment 3 Colin Walters 2009-07-10 16:48:04 UTC
Applied, thanks!


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.