Linux bluetooth development
 help / color / mirror / Atom feed
From: Angela Bartholomaus <angelab@codeaurora.org>
To: linux-bluetooth@vger.kernel.org
Cc: rshaffer@codeaurora.org, marcel@holtmann.org,
	johan.hedberg@gmail.com,
	Angela Bartholomaus <angelab@codeaurora.org>
Subject: [PATCH 4/4] Send Invalid Syntax Error if Resp Size Less Than 0x07
Date: Tue, 24 Aug 2010 15:14:20 -0700	[thread overview]
Message-ID: <1282688060-10727-5-git-send-email-angelab@codeaurora.org> (raw)
In-Reply-To: <1282688060-10727-1-git-send-email-angelab@codeaurora.org>

Added in error catching, when a badly formed request comes in
---
 src/sdpd-request.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/sdpd-request.c b/src/sdpd-request.c
index 8547939..205b27b 100644
--- a/src/sdpd-request.c
+++ b/src/sdpd-request.c
@@ -684,6 +684,15 @@ static int service_attr_req(sdp_req_t *req, sdp_buf_t *buf)
 	SDPDBG("max_rsp_size : %d", max_rsp_size);
 
 	/*
+	 * Check that max_rsp_size is within valid range
+	 * a minimum size of 0x0007 has to be used for data field
+	 */
+	if (max_rsp_size < 0x0007) {
+		status = SDP_INVALID_SYNTAX;
+		goto done;
+	}
+
+	/*
 	 * Calculate Attribute size acording to MTU
 	 * We can send only (MTU - sizeof(sdp_pdu_hdr_t) - sizeof(sdp_cont_state_t))
 	 */
-- 
1.7.0.2
--
Angela Bartholomaus
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  parent reply	other threads:[~2010-08-24 22:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 22:14 [PATCH 0/4] Fix error reporting for SDP Requests Angela Bartholomaus
2010-08-24 22:14 ` [PATCH 1/4] Send an Invalid PDU Size Error Response for Service Search Req Angela Bartholomaus
2010-08-24 22:14 ` [PATCH 2/4] Send an Invalid PDU Size Error Response for Service Attr Req Angela Bartholomaus
2010-08-24 22:14 ` [PATCH 3/4] Send an Invalid PDU Size Error Resp for Service Attr Search Req Angela Bartholomaus
2010-08-24 22:14 ` Angela Bartholomaus [this message]
2010-08-24 22:21 ` [PATCH 0/4] Fix error reporting for SDP Requests Marcel Holtmann
2010-08-24 22:55   ` angelab
2010-08-24 23:15     ` 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=1282688060-10727-5-git-send-email-angelab@codeaurora.org \
    --to=angelab@codeaurora.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=rshaffer@codeaurora.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