Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ] Fix memory corruption when decoding Read Response PDU
Date: Mon, 3 Oct 2011 11:51:45 +0300	[thread overview]
Message-ID: <20111003085145.GC8956@fusion.localdomain> (raw)
In-Reply-To: <1317236492-13064-1-git-send-email-anderson.lizardo@openbossa.org>

Hi Lizardo,

On Wed, Sep 28, 2011, Anderson Lizardo wrote:
> A bogus (or hostile) Proximity Reporter device may send a TX Power value
> bigger than the buffer used. Therefore, create a temporary buffer with
> the maximum size, and check for the length before using the value.
> 
> Note that all other current users of the dec_read_resp() already do
> this. Another option would be to change dec_read_resp() to accept a
> buffer length, but this would break external code, so it is avoided for
> now.
> ---
>  proximity/monitor.c |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)

Applied. Thanks.

Have you considered changing the API so that the caller could tell the
function the size of the supplied buffer?

Another thing (though unrelated to this patch) I noticed: whenever you
have variables that denote some kind of size and are not directly bound
to fixed-length fields in PDU's, please use size_t or ssize_t. Feel free
to send patches to fix such issues in your code.

Johan

  reply	other threads:[~2011-10-03  8:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28 19:01 [PATCH BlueZ] Fix memory corruption when decoding Read Response PDU Anderson Lizardo
2011-10-03  8:51 ` Johan Hedberg [this message]
2011-10-03 22:59   ` Anderson Lizardo
2011-10-05 10:32     ` 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=20111003085145.GC8956@fusion.localdomain \
    --to=johan.hedberg@gmail.com \
    --cc=anderson.lizardo@openbossa.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