From: Stephen Crane <jscrane@maths.tcd.ie>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] marshalling SDP_URL_STR
Date: Tue, 23 Jan 2007 15:42:03 +0000 [thread overview]
Message-ID: <20070123154203.GA30435@salmon.maths.tcd.ie> (raw)
[-- Attachment #1: Type: text/plain, Size: 398 bytes --]
Hello again,
It looks as if these types aren't being marshalled properly in the SDP
library. (They should be treated identically to SDP_TEXT_STR.)
The current code causes 1 byte too many to be allocated to them in the
marshalled form which results in garbage when it is read out of the
buffer.
The attached patch treats them the same as SDP_TEXT_STR, aside from the
DTD of course.
Cheers,
Steve
[-- Attachment #2: sdp.c.patch --]
[-- Type: text/plain, Size: 716 bytes --]
Index: sdp.c
===================================================================
RCS file: /cvsroot/bluez/libs/src/sdp.c,v
retrieving revision 1.70
diff -u -r1.70 sdp.c
--- sdp.c 9 Nov 2006 21:25:30 -0000 1.70
+++ sdp.c 23 Jan 2007 15:38:33 -0000
@@ -741,15 +741,11 @@
case SDP_TEXT_STR8:
case SDP_TEXT_STR16:
case SDP_TEXT_STR32:
- src = (unsigned char *)d->val.str;
- data_size = d->unitSize - sizeof(uint8_t);
- sdp_set_seq_len(seqp, data_size);
- break;
case SDP_URL_STR8:
case SDP_URL_STR16:
case SDP_URL_STR32:
src = (unsigned char *)d->val.str;
- data_size = strlen(d->val.str);
+ data_size = d->unitSize - sizeof(uint8_t);
sdp_set_seq_len(seqp, data_size);
break;
case SDP_SEQ8:
[-- Attachment #3: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next reply other threads:[~2007-01-23 15:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-23 15:42 Stephen Crane [this message]
2007-01-31 11:25 ` [Bluez-devel] marshalling SDP_URL_STR 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=20070123154203.GA30435@salmon.maths.tcd.ie \
--to=jscrane@maths.tcd.ie \
--cc=bluez-devel@lists.sourceforge.net \
/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