]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
transport: Don't pile up errors for semicolon-separated components
authorSimon McVittie <smcv@collabora.com>
Mon, 5 Jun 2017 17:16:42 +0000 (18:16 +0100)
committerSimon McVittie <smcv@collabora.com>
Thu, 8 Jun 2017 15:59:13 +0000 (16:59 +0100)
If we somehow get an autolaunch address with multiple
semicolon-separated components, and one of them fails, then we will
hit an assertion failure when we try the next one.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101257

dbus/dbus-transport.c

index 69e2241d7296c0f9d9857927b17004892363108c..f2a961503b255a8f70ade8c61c68aebb964817b5 100644 (file)
@@ -254,13 +254,16 @@ check_address (const char *address, DBusError *error)
   int len, i;
 
   _dbus_assert (address != NULL);
+  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
   if (!dbus_parse_address (address, &entries, &len, error))
     return NULL;              /* not a valid address */
 
   for (i = 0; i < len; i++)
     {
+      dbus_error_free (error);
       transport = _dbus_transport_open (entries[i], error);
+
       if (transport != NULL)
         break;
     }