public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: evermind@tuxfamily.org
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Fix segfault: If the interface name is NULL the bluetoothd daemon will crash
Date: Wed, 25 Feb 2009 15:13:34 +0100	[thread overview]
Message-ID: <1235571214.24169.18.camel@localhost.localdomain> (raw)
In-Reply-To: <1235563011-1432-1-git-send-email-evermind@tuxfamily.org>

Hi Frieder,

> ---
>  gdbus/object.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/gdbus/object.c b/gdbus/object.c
> index 0786aeb..d920eac 100644
> --- a/gdbus/object.c
> +++ b/gdbus/object.c
> @@ -224,11 +224,12 @@ static struct interface_data *find_interface(GSList *interfaces,
>  {
>  	GSList *list;
>  
> -	for (list = interfaces; list; list = list->next) {
> -		struct interface_data *iface = list->data;
> -		if (!strcmp(name, iface->name))
> -			return iface;
> -	}
> +	if (name)
> +		for (list = interfaces; list; list = list->next) {
> +			struct interface_data *iface = list->data;
> +			if (!strcmp(name, iface->name))
> +				return iface;
> +		}
>  
>  	return NULL;
>  }

what about something like this:

	if (name == NULL)
		return NULL;

Regards

Marcel



  reply	other threads:[~2009-02-25 14:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 11:56 [PATCH] Fix segfault: If the interface name is NULL the bluetoothd daemon will crash evermind
2009-02-25 14:13 ` Marcel Holtmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-02-26  8:35 Frieder Buerzele
2009-02-26  8:35 ` Frieder Buerzele
2009-02-26  8:46 Frieder Buerzele
2009-02-26  8:46 ` Frieder Buerzele
2009-02-28 21:46   ` Marcel Holtmann

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=1235571214.24169.18.camel@localhost.localdomain \
    --to=marcel@holtmann.org \
    --cc=evermind@tuxfamily.org \
    --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