public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: "Gustavo F. Padovan" <gustavo@las.ic.unicamp.br>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/3] Fix memset of sco_opt
Date: Wed, 1 Apr 2009 08:56:35 +0300	[thread overview]
Message-ID: <20090401055635.GC17550@jh-x301> (raw)
In-Reply-To: <1238553045-23938-3-git-send-email-gustavo@las.ic.unicamp.br>

Hi,

On Tue, Mar 31, 2009, Gustavo F. Padovan wrote:
> Now len has the correct value: sizeof(sco_opt)
> ---
>  common/btio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/btio.c b/common/btio.c
> index 9ff407f..030feda 100644
> --- a/common/btio.c
> +++ b/common/btio.c
> @@ -573,8 +573,8 @@ static gboolean sco_set(int sock, uint16_t mtu, GError **err)
>  	if (!mtu)
>  		return TRUE;
>  
> -	memset(&sco_opt, 0, len);
>  	len = sizeof(sco_opt);
> +	memset(&sco_opt, 0, len);
>  	if (getsockopt(sock, SOL_SCO, SCO_OPTIONS, &sco_opt, &len) < 0) {
>  		ERROR_FAILED(err, "getsockopt(SCO_OPTIONS)", errno);
>  		return FALSE;

Nice catch! This one has also been pushed upstream. It's strange though that we
haven't noticed any uninitialized variable compiler warnings because of it
earlier.

Johan

  reply	other threads:[~2009-04-01  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-01  2:30 [PATCH 1/3] Fix null dereference in src/main.c Gustavo F. Padovan
2009-04-01  2:30 ` [PATCH 2/3] Fix null dereference in gdbus/watch.c Gustavo F. Padovan
2009-04-01  2:30   ` [PATCH 3/3] Fix memset of sco_opt Gustavo F. Padovan
2009-04-01  5:56     ` Johan Hedberg [this message]
2009-04-01  5:54   ` [PATCH 2/3] Fix null dereference in gdbus/watch.c Johan Hedberg
2009-04-01  5:52 ` [PATCH 1/3] Fix null dereference in src/main.c 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=20090401055635.GC17550@jh-x301 \
    --to=johan.hedberg@gmail.com \
    --cc=gustavo@las.ic.unicamp.br \
    --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