Re: [PATCH BlueZ] src/adapter: Add the NULL check for response

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Mar 27, 2017 at 4:18 AM,  <hyuk0512@xxxxxxxxx> wrote:
> From: Lee Hyuk <hyuk0512.lee@xxxxxxxxxxx>
>
> The response can be NULL pointer. It should be checked.
> ---
>  src/adapter.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/adapter.c b/src/adapter.c
> index 3dac7d6..472b817 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -1227,6 +1227,9 @@ static void passive_scanning_complete(uint8_t status, uint16_t length,
>         struct btd_adapter *adapter = user_data;
>         const struct mgmt_cp_start_discovery *rp = param;
>
> +       if (!rp)
> +               return;
> +
>         DBG("status 0x%02x", status);
>
>         if (length < sizeof(*rp)) {
> --
> 1.9.1

It looks like you might have a broken kernel in this regard since
Start Discovery shall always return the parameters given and in case
it doesn't it is probably a nice thing to log an error.

-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux