public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: "Elvis Pfützenreuter" <epx@signove.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Fix crash when HDP first reliable channel is nil
Date: Tue, 27 Mar 2012 14:36:51 +0300	[thread overview]
Message-ID: <20120327113651.GF14481@x220> (raw)
In-Reply-To: <1331938389-4856-1-git-send-email-epx@signove.com>

Hi Elvis,

On Fri, Mar 16, 2012, Elvis Pfützenreuter wrote:
> Congruent to health_channel_destroy(), the "/" path is returned by MainChannel
> property of HealthDevice when the first reliable channel is nil.
> 
> An empty path provokes the following error:
> 
> process xxxs: arguments to dbus_message_iter_append_basic() were incorrect,
> assertion "_dbus_check_is_valid_path (*string_p)" failed in file
> ../../dbus/dbus-message.c line 2539.  This is normally a bug in some
> application using the D-Bus library.
> ---
>  health/hdp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/health/hdp.c b/health/hdp.c
> index 812352f..eba438a 100644
> --- a/health/hdp.c
> +++ b/health/hdp.c
> @@ -2077,7 +2077,7 @@ static DBusMessage *device_get_properties(DBusConnection *conn,
>  	if (device->fr != NULL)
>  		path = g_strdup(device->fr->path);
>  	else
> -		path = g_strdup("");
> +		path = g_strdup("/");
>  	dict_append_entry(&dict, "MainChannel", DBUS_TYPE_OBJECT_PATH, &path);
>  	g_free(path);
>  	dbus_message_iter_close_container(&iter, &dict);

Would it maybe make more sense to simply not include this property in
the property list if device->fr is NULL? (after all, there's nothing
interesting to be found at "/" from a HDP perspective)

Johan

  reply	other threads:[~2012-03-27 11:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 22:53 [PATCH] Fix crash when HDP first reliable channel is nil Elvis Pfützenreuter
2012-03-27 11:36 ` Johan Hedberg [this message]
2012-03-27 11:59   ` Elvis Pfutzenreuter
2012-03-27 12:18     ` Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120327113651.GF14481@x220 \
    --to=johan.hedberg@gmail.com \
    --cc=epx@signove.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox