* [Bluez-devel] Re: DUN lookup on Samsung D500 raises SIGSEGV
@ 2005-09-30 14:31 Loïc Lefort
2005-09-30 14:44 ` Marcel Holtmann
0 siblings, 1 reply; 4+ messages in thread
From: Loïc Lefort @ 2005-09-30 14:31 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 113 bytes --]
Hi Marcel,
here is the patch as an attachment.
Loïc
--
Loïc Lefort <loic.lefort@ismart.fr>
iSmart
[-- Attachment #2: samsung-patch --]
[-- Type: text/plain, Size: 1042 bytes --]
--- bluez-libs-2.19/src/sdp.c 2005-08-06 13:13:58.000000000 +0200
+++ bluez-libs-2.19-patched-for-d500/src/sdp.c 2005-09-29 13:46:38.000000000 +0200
@@ -1526,12 +1526,24 @@
return -1;
}
for (seq = sdpdata->val.dataseq; seq && seq->val.dataseq; seq = seq->next) {
- sdp_data_t *uuid = seq->val.dataseq;
- sdp_data_t *pVnum = seq->val.dataseq->next;
- if (uuid && pVnum) {
+ uuid_t *uuid = NULL;
+ uint16_t version = 0x100;
+
+ if (SDP_IS_UUID(seq->dtd)) {
+ uuid = &seq->val.uuid;
+ } else {
+ sdp_data_t *puuid = seq->val.dataseq;
+ sdp_data_t *pVnum = seq->val.dataseq->next;
+ if (puuid && pVnum) {
+ uuid = &puuid->val.uuid;
+ version = pVnum->val.uint16;
+ }
+ }
+
+ if (uuid != NULL) {
profDesc = (sdp_profile_desc_t *)malloc(sizeof(sdp_profile_desc_t));
- profDesc->uuid = uuid->val.uuid;
- profDesc->version = pVnum->val.uint16;
+ profDesc->uuid = *uuid;
+ profDesc->version = version;
#ifdef SDP_DEBUG
sdp_uuid_print(&profDesc->uuid);
SDPDBG("Vnum : 0x%04x\n", profDesc->version);
^ permalink raw reply [flat|nested] 4+ messages in thread* [Bluez-devel] Re: DUN lookup on Samsung D500 raises SIGSEGV
@ 2005-09-30 10:42 Loïc Lefort
2005-09-30 12:08 ` Marcel Holtmann
0 siblings, 1 reply; 4+ messages in thread
From: Loïc Lefort @ 2005-09-30 10:42 UTC (permalink / raw)
To: bluez-devel
Here is a patch to fix the SEGV when doing DUN lookup on Samsung phones
(at least D500 and E720).
The diagnostic for the bug is here:
http://sourceforge.net/mailarchive/message.php?msg_id=3D11057684
The problem is that the Samsung phones return a sequence of uuid for
BTProfileDescList instead
of a sequence of (sequence uuid version).
The patch detects the "sequence of uuid" case and uses a default version
number of 0x100,
as recommended in:
http://sourceforge.net/mailarchive/message.php?msg_id=3D11202759
The other case is unchanged.
Tested with these phones: Samsung D500 and E720, Nokia 6680.
--- bluez-libs-2.19/src/sdp.c 2005-08-06 13:13:58.000000000 +0200
+++ bluez-libs-2.19-patched-for-d500/src/sdp.c 2005-09-29
13:46:38.000000000 +0 200
@@ -1526,12 +1526,24 @@
return -1;
}
for (seq =3D sdpdata->val.dataseq; seq && seq->val.dataseq; seq =3D
seq->nex t) {
- sdp_data_t *uuid =3D seq->val.dataseq;
- sdp_data_t *pVnum =3D seq->val.dataseq->next;
- if (uuid && pVnum) {
+ uuid_t *uuid =3D NULL;
+ uint16_t version =3D 0x100;
+
+ if (SDP_IS_UUID(seq->dtd)) {
+ uuid =3D &seq->val.uuid;
+ } else {
+ sdp_data_t *puuid =3D seq->val.dataseq;
+ sdp_data_t *pVnum =3D seq->val.dataseq->next;
+ if (puuid && pVnum) {
+ uuid =3D &puuid->val.uuid;
+ version =3D pVnum->val.uint16;
+ }
+ }
+
+ if (uuid !=3D NULL) {
profDesc =3D (sdp_profile_desc_t
*)malloc(sizeof(sdp_profi le_desc_t));
- profDesc->uuid =3D uuid->val.uuid;
- profDesc->version =3D pVnum->val.uint16;
+ profDesc->uuid =3D *uuid;
+ profDesc->version =3D version;
#ifdef SDP_DEBUG
sdp_uuid_print(&profDesc->uuid);
SDPDBG("Vnum : 0x%04x\n", profDesc->version);
--=20
Lo=EFc Lefort <loic.lefort@inelis.org>
inelis
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-09-30 14:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-30 14:31 [Bluez-devel] Re: DUN lookup on Samsung D500 raises SIGSEGV Loïc Lefort
2005-09-30 14:44 ` Marcel Holtmann
-- strict thread matches above, loose matches on Subject: below --
2005-09-30 10:42 Loïc Lefort
2005-09-30 12:08 ` Marcel Holtmann
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).