Skip to contentSkip to conversation

lib/sdp.c: Validate attribute search return value

PATCH Applied Aravind Machiry 3 participants 4 messages Sep 28, 2020 – Oct 8, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/sdp.c: Validate attribute search return value

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(+)
lib/sdp.c +16 -0
index 532039a23..a27cd3a7b 100644
@@ -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 */
Signature · 1 line
2.25.1
#1 lore raw

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

#2 lore raw

Gentle reminder!

Quoted 29 lines · On Mon, Sep 28, 2020 at 12:32 AM <[email protected]> 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

maintainer Applied
#3 lore raw

Hi,

Quoted 33 lines · Aravind Machiry

Gentle reminder!

Quoted 29 lines · On Mon, Sep 28, 2020 at 12:32 AM <[email protected]> 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.

Signature · 1 line
Luiz Augusto von Dentz