linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] lib/sdp.c: Validate attribute search return value
@ 2020-09-28  6:44 Aravind Machiry
  2020-09-28  7:32 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 4+ messages in thread
From: Aravind Machiry @ 2020-09-28  6:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: mhnaik, liby99, Aravind Machiry

The calls to gen_[searchseq|attridseq]_seq functions return negative
value on failure. The return value should be checked to gracefully
exit with a proper exit code.
---
 lib/sdp.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/lib/sdp.c b/lib/sdp.c
index 532039a23..a27cd3a7b 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -3419,6 +3419,12 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search,
 	/* add service class IDs for search */
 	seqlen = gen_searchseq_pdu(pdata, search);
 
+	if (seqlen < 0) {
+		errno = EINVAL;
+		status = -1;
+		goto end;
+	}
+
 	SDPDBG("Data seq added : %d", seqlen);
 
 	/* set the length and increment the pointer */
@@ -3841,6 +3847,11 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u
 	/* add service class IDs for search */
 	seqlen = gen_searchseq_pdu(pdata, search);
 
+	if (seqlen < 0) {
+		t->err = EINVAL;
+		goto end;
+	}
+
 	SDPDBG("Data seq added : %d", seqlen);
 
 	/* now set the length and increment the pointer */
@@ -4054,6 +4065,11 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear
 	/* add service class IDs for search */
 	seqlen = gen_searchseq_pdu(pdata, search);
 
+	if (seqlen < 0) {
+		t->err = EINVAL;
+		goto end;
+	}
+
 	SDPDBG("Data seq added : %d", seqlen);
 
 	/* now set the length and increment the pointer */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [BlueZ] lib/sdp.c: Validate attribute search return value
  2020-09-28  6:44 [PATCH BlueZ] lib/sdp.c: Validate attribute search return value Aravind Machiry
@ 2020-09-28  7:32 ` bluez.test.bot
  2020-10-03 18:11   ` Aravind Machiry
  0 siblings, 1 reply; 4+ messages in thread
From: bluez.test.bot @ 2020-09-28  7:32 UTC (permalink / raw)
  To: linux-bluetooth, machiry

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=356319

---Test result---

##############################
Test: CheckPatch - PASS

##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuild - PASS

##############################
Test: MakeCheck - PASS



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BlueZ] lib/sdp.c: Validate attribute search return value
  2020-09-28  7:32 ` [BlueZ] " bluez.test.bot
@ 2020-10-03 18:11   ` Aravind Machiry
  2020-10-07 23:59     ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 4+ messages in thread
From: Aravind Machiry @ 2020-10-03 18:11 UTC (permalink / raw)
  To: linux-bluetooth

Gentle reminder!

On Mon, Sep 28, 2020 at 12:32 AM <bluez.test.bot@gmail.com> wrote:
>
> This is automated email and please do not reply to this email!
>
> Dear submitter,
>
> Thank you for submitting the patches to the linux bluetooth mailing list.
> This is a CI test results with your patch series:
> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=356319
>
> ---Test result---
>
> ##############################
> Test: CheckPatch - PASS
>
> ##############################
> Test: CheckGitLint - PASS
>
> ##############################
> Test: CheckBuild - PASS
>
> ##############################
> Test: MakeCheck - PASS
>
>
>
> ---
> Regards,
> Linux Bluetooth
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BlueZ] lib/sdp.c: Validate attribute search return value
  2020-10-03 18:11   ` Aravind Machiry
@ 2020-10-07 23:59     ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2020-10-07 23:59 UTC (permalink / raw)
  To: Aravind Machiry; +Cc: linux-bluetooth

Hi,

On Sat, Oct 3, 2020 at 11:14 AM Aravind Machiry <machiry@cs.ucsb.edu> wrote:
>
> Gentle reminder!
>
> On Mon, Sep 28, 2020 at 12:32 AM <bluez.test.bot@gmail.com> wrote:
> >
> > This is automated email and please do not reply to this email!
> >
> > Dear submitter,
> >
> > Thank you for submitting the patches to the linux bluetooth mailing list.
> > This is a CI test results with your patch series:
> > PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=356319
> >
> > ---Test result---
> >
> > ##############################
> > Test: CheckPatch - PASS
> >
> > ##############################
> > Test: CheckGitLint - PASS
> >
> > ##############################
> > Test: CheckBuild - PASS
> >
> > ##############################
> > Test: MakeCheck - PASS
> >
> >
> >
> > ---
> > Regards,
> > Linux Bluetooth
> >

Applied, thanks.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-08  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28  6:44 [PATCH BlueZ] lib/sdp.c: Validate attribute search return value Aravind Machiry
2020-09-28  7:32 ` [BlueZ] " bluez.test.bot
2020-10-03 18:11   ` Aravind Machiry
2020-10-07 23:59     ` 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;
as well as URLs for NNTP newsgroup(s).