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 4/6] Bluetooth: Refactor UUID-16 list generation into its own function
Date: Fri, 25 Jan 2013 08:37:52 +0200	[thread overview]
Message-ID: <20130125063752.GA16528@x220.ger.corp.intel.com> (raw)
In-Reply-To: <CAJdJm_OqePCY1yMvJTwaUDnXTMbDJgucbYvEWT99=K9tbvgYQg@mail.gmail.com>

Hi Lizardo,

On Thu, Jan 24, 2013, Anderson Lizardo wrote:
> On Thu, Jan 24, 2013 at 4:21 PM, Anderson Lizardo
> <anderson.lizardo@openbossa.org> wrote:
> > Hi Johan,
> >
> > On Thu, Jan 24, 2013 at 3:03 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> >> +static u8 *create_uuid16_list(struct hci_dev *hdev, u8 *data, ptrdiff_t len)
> >> +{
> >> +       u8 *ptr = data, *uuids_start = NULL;
> >> +       struct bt_uuid *uuid;
> >
> > Maybe you should check for "len < 2" here?
> 
> Actually, "len < 4", to be able to fit at least a 16-bit UUID.

The way the EIR is constructed right now it's impossible for this
condition to be met (i.e. the only variable length field before the
UUID-16 list is the name which we limit to 48 bytes). Anyway, in case we
add more stuff to the beginning of the EIR in the future I agree that
it's good to have this check in place so we avoid stupid bugs.

I'll be sending a v2 of the set (also including a simplification to the
first patch) soon.

Johan

  reply	other threads:[~2013-01-25  6:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 19:03 [PATCH 0/6] Bluetooth: Add 32 and 128 bit EIR UUID support Johan Hedberg
2013-01-24 19:03 ` [PATCH 1/6] Bluetooth: Split UUIDs to three separate lists Johan Hedberg
2013-01-24 19:03 ` [PATCH 2/6] Bluetooth: Simplify UUID16 list generation for EIR Johan Hedberg
2013-01-24 19:03 ` [PATCH 3/6] Bluetooth: Remove useless eir_len variable from EIR creation Johan Hedberg
2013-01-24 19:03 ` [PATCH 4/6] Bluetooth: Refactor UUID-16 list generation into its own function Johan Hedberg
2013-01-24 20:21   ` Anderson Lizardo
2013-01-24 20:25     ` Anderson Lizardo
2013-01-25  6:37       ` Johan Hedberg [this message]
2013-01-24 19:03 ` [PATCH 5/6] Bluetooth: Add support for 32-bit UUIDs in EIR data Johan Hedberg
2013-01-24 19:03 ` [PATCH 6/6] Bluetooth: Add support for 128-bit " 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=20130125063752.GA16528@x220.ger.corp.intel.com \
    --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