linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] Fix possible crash while verifying avdtp version
Date: Wed, 17 Feb 2010 11:39:44 +0200	[thread overview]
Message-ID: <2d5a2c101002170139x52314d9g7b665c7fb769f40c@mail.gmail.com> (raw)

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

Hi,

Codenomicon a2dp tests makes bluetoothd to crash due to a malformed
sdp record (BlueZ 4.60):

Signal 11 (SIGSEGV)
0		avdtp_get_internal () at audio/avdtp.c:2073
1	0x00022f18	avdtp_confirm_cb (chan=0x6c0e0) at audio/avdtp.c:2266
2	0x0003a7dc	server_cb (user_data=0x6d380) at src/btio.c:193

-- 
Luiz Augusto von Dentz
Computer Engineer

[-- Attachment #2: 0001-Fix-possible-crash-while-verifying-avdtp-version.patch --]
[-- Type: text/x-patch, Size: 824 bytes --]

From 9fa60aa616ed1e6c7278f0cb265c881c80e628f3 Mon Sep 17 00:00:00 2001
From: Luiz Augusto Von Dentz <luiz.dentz-von@nokia.com>
Date: Wed, 17 Feb 2010 11:22:16 +0200
Subject: [PATCH] Fix possible crash while verifying avdtp version

Reproducible with Codenomicon A2DP testsuite 1.4.2.
---
 audio/avdtp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/avdtp.c b/audio/avdtp.c
index 3b9c6c1..efed9b6 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -2125,7 +2125,7 @@ static uint16_t get_version(struct avdtp *session)
 		goto done;
 
 	proto_desc = sdp_get_proto_desc(protos, AVDTP_UUID);
-	if (proto_desc->dtd == SDP_UINT16)
+	if (proto_desc && proto_desc->dtd == SDP_UINT16)
 		ver = proto_desc->val.uint16;
 
 	sdp_list_foreach(protos, (sdp_list_func_t) sdp_list_free, NULL);
-- 
1.6.3.3


             reply	other threads:[~2010-02-17  9:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-17  9:39 Luiz Augusto von Dentz [this message]
2010-02-17 10:01 ` [PATCH] Fix possible crash while verifying avdtp version Marcel Holtmann

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=2d5a2c101002170139x52314d9g7b665c7fb769f40c@mail.gmail.com \
    --to=luiz.dentz@gmail.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).