From: "Frédéric Dalleau" <frederic.dalleau@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: "Frédéric Dalleau" <frederic.dalleau@linux.intel.com>
Subject: [PATCH 1/2] sdp: Check type of sdp data before dereferencing
Date: Mon, 20 Feb 2012 21:57:57 +0100 [thread overview]
Message-ID: <1329771478-3935-2-git-send-email-frederic.dalleau@linux.intel.com> (raw)
In-Reply-To: <1329771478-3935-1-git-send-email-frederic.dalleau@linux.intel.com>
---
lib/sdp.c | 2 +-
lib/sdp.h | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/sdp.c b/lib/sdp.c
index a48ee14..57f630a 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -2065,7 +2065,7 @@ int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq)
if (SDP_IS_UUID(seq->dtd)) {
uuid = &seq->val.uuid;
- } else {
+ } else if (SDP_IS_SEQ(seq->dtd)) {
sdp_data_t *puuid = seq->val.dataseq;
sdp_data_t *pVnum = seq->val.dataseq->next;
if (puuid && pVnum) {
diff --git a/lib/sdp.h b/lib/sdp.h
index 5f7d271..2fe74d5 100644
--- a/lib/sdp.h
+++ b/lib/sdp.h
@@ -432,6 +432,7 @@ typedef struct {
} uuid_t;
#define SDP_IS_UUID(x) ((x) == SDP_UUID16 || (x) == SDP_UUID32 || (x) ==SDP_UUID128)
+#define SDP_IS_SEQ(x) ((x) == SDP_SEQ8 || (x) == SDP_SEQ16 || (x) == SDP_SEQ32)
typedef struct _sdp_list sdp_list_t;
struct _sdp_list {
--
1.7.5.4
next prev parent reply other threads:[~2012-02-20 20:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 20:57 [PATCH 0/2] Fix crash in profile descriptor list parsing Frédéric Dalleau
2012-02-20 20:57 ` Frédéric Dalleau [this message]
2012-02-20 20:57 ` [PATCH 2/2] sdp: Fix sdp_get_profile_descs for Mac Os X Lion Frédéric Dalleau
2012-03-13 14:20 ` Johan Hedberg
2012-03-14 15:11 ` Dalleau, Frederic
2012-03-08 10:11 ` [PATCH 0/2] Fix crash in profile descriptor list parsing Dalleau, Frederic
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=1329771478-3935-2-git-send-email-frederic.dalleau@linux.intel.com \
--to=frederic.dalleau@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).