dbus_message_iter_open_container called with an invalid signature

Bug #1098723 reported by Charbonnier
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dbus-c++ (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hi!

This is an old bug which generate the this exception:

arguments to dbus_message_iter_open_container() were incorrect, assertion "(type == DBUS_TYPE_STRUCT && contained_signature == NULL) || (type == DBUS_TYPE_DICT_ENTRY && contained_signature == NULL) || (type == DBUS_TYPE_VARIANT && contained_signature != NULL) || (type == DBUS_TYPE_ARRAY && contained_signature != NULL)" failed in file ../../dbus/dbus-message.c line 2727.

This bug has been already reported on sourceforge, but never corrected.
http://sourceforge.net/p/dbus-cplusplus/bugs/5/

However, the solution is simple and already applied on several dbus-c++ forks:
- in the "async" version maintained by sjames at git://gitorious.org/~sjames/dbus-cplusplus/async.git
- Chromium has the same correction. The log associated with the commit is at:
http://git.chromium.org/gitweb/?p=chromiumos/third_party/dbus-cplusplus.git;a=commit;h=32fe2ce6a60f6f9e5771c639598050798a4feae8

Basically, the correction is very simple:

diff --git a/src/message.cpp b/src/message.cpp
index 3f0cac4..7afa49b 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -350,7 +350,7 @@ void MessageIter::copy_data(MessageIter &to)
       (
         (DBusMessageIter *) & (to._iter),
         from.type(),
- from.type() == DBUS_TYPE_VARIANT ? NULL : sig,
+ (from.type() == DBUS_TYPE_STRUCT) || (from.type() == DBUS_TYPE_DICT_ENTRY) ? NULL : sig,
         (DBusMessageIter *) & (to_container._iter)
       );

I would be glad to see this bug corrected in ubuntu.

Best regards,
Bigfoot.

Revision history for this message
Charbonnier (charboma38) wrote :

Any way to get this bug fixed? I'm getting bored to compile this lib again and again every 6 months...

Revision history for this message
Thomas Uhle (uhle) wrote :

The same bug has been reported at https://sourceforge.net/p/dbus-cplusplus/bugs/20/ too.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dbus-c++ (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dbus-c++ - 0.9.0-11

---------------
dbus-c++ (0.9.0-11) unstable; urgency=medium

  * QA upload.
  * Add 09_fix_build_order_and_linking.patch to change the order in which the
    libraries are built and to fix the underlinking issue. (Closes: #889114)
  * Add 10_prevent_deadlock_on_timeout_expiration.patch to prevent a possible
    deadlock. (Closes: #956114)
  * Add 11_fix_MessageIter__copy_data.patch to fix copying nested types in
    dicts and structs. (LP: #1098723)
  * Add 12_autoconf_update.patch to avoid hard-to-read deprecation warnings
    that clutter the build logs.
  * Update 01_host_name_max.patch because stdio.h is needed by perror().
  * debian/control:
    + Add libdbus-1-dev to libdbus-c++-dev's dependencies. (Closes: #1018771)
    + Fix spelling and capitalization of the package descriptions.
    + Update Homepage to use https URL.
    + Mark libdbus-c++-bin as Multi-Arch: allowed. It fixes a regression since
      version 0.9.0-9.
    + Add Rules-Requires-Root: no.
    + Bump Standards-Version to 4.6.2, no changes needed.
  * debian/copyright:
    + Add Upstream-Contact, information copied from configure.ac.
    + Update packaging copyright according to debian/changelog and
      debian/patches.
  * debian/watch: Use uscan version 4.
  * Add debian/upstream/metadata.

 -- Thomas Uhle <email address hidden> Wed, 22 Feb 2023 22:55:50 +0100

Changed in dbus-c++ (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.