* [PATCH BlueZ] src/adapter: Add the NULL check for response [not found] <CGME20170327011830epcas5p448d6a1d19f613c5962d386546fe9ecf5@epcas5p4.samsung.com> @ 2017-03-27 1:18 ` hyuk0512 2017-03-27 1:18 ` hyuk0512 0 siblings, 1 reply; 3+ messages in thread From: hyuk0512 @ 2017-03-27 1:18 UTC (permalink / raw) To: linux-bluetooth; +Cc: Lee Hyuk From: Lee Hyuk <hyuk0512.lee@samsung.com> It is just bug fix. Please review this. Lee Hyuk (1): src/adapter: Add the NULL check for response src/adapter.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH BlueZ] src/adapter: Add the NULL check for response 2017-03-27 1:18 ` [PATCH BlueZ] src/adapter: Add the NULL check for response hyuk0512 @ 2017-03-27 1:18 ` hyuk0512 2017-03-27 10:54 ` Luiz Augusto von Dentz 0 siblings, 1 reply; 3+ messages in thread From: hyuk0512 @ 2017-03-27 1:18 UTC (permalink / raw) To: linux-bluetooth; +Cc: Lee Hyuk From: Lee Hyuk <hyuk0512.lee@samsung.com> 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 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ] src/adapter: Add the NULL check for response 2017-03-27 1:18 ` hyuk0512 @ 2017-03-27 10:54 ` Luiz Augusto von Dentz 0 siblings, 0 replies; 3+ messages in thread From: Luiz Augusto von Dentz @ 2017-03-27 10:54 UTC (permalink / raw) To: hyuk0512; +Cc: linux-bluetooth@vger.kernel.org, Lee Hyuk Hi, On Mon, Mar 27, 2017 at 4:18 AM, <hyuk0512@gmail.com> wrote: > From: Lee Hyuk <hyuk0512.lee@samsung.com> > > 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-27 10:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20170327011830epcas5p448d6a1d19f613c5962d386546fe9ecf5@epcas5p4.samsung.com>
2017-03-27 1:18 ` [PATCH BlueZ] src/adapter: Add the NULL check for response hyuk0512
2017-03-27 1:18 ` hyuk0512
2017-03-27 10:54 ` Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox