All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] null bytes in 'SDP_TEXT_STR8' data element
@ 2005-06-26 22:07 Raimund Steger
  2005-06-27  5:50 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Raimund Steger @ 2005-06-26 22:07 UTC (permalink / raw)
  To: bluez-devel

Hi,

I have problems adding a "TEXT" attribute value to a service
record that contains '0x00' bytes. First, it seems like the sdp_data_alloc()
function does use strlen() for text entries which will use these
bytes as string terminators.

Second, I use the JSR-82 library from Avetana, where the service record
gets registered via send_req_w4_rsp which seems to be null-byte safe.
However, when someone queries the record, the string element is again
truncated which seems to happen in the sdp_gen_pdu() function in
sdp/sdp.c [of bluez-libs-2.17], l. 686, where strlen() is used to
determine the string element's length. Would it be possible to use
d->unitSize in this place instead?

Thanks,

Raimund



-- 
R.Steger  ICQ# 16845346  Tel  +49-179-2981632



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bluez-devel] null bytes in 'SDP_TEXT_STR8' data element
  2005-06-26 22:07 [Bluez-devel] null bytes in 'SDP_TEXT_STR8' data element Raimund Steger
@ 2005-06-27  5:50 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2005-06-27  5:50 UTC (permalink / raw)
  To: bluez-devel

Hi Raimund,

> I have problems adding a "TEXT" attribute value to a service
> record that contains '0x00' bytes. First, it seems like the sdp_data_alloc()
> function does use strlen() for text entries which will use these
> bytes as string terminators.
> 
> Second, I use the JSR-82 library from Avetana, where the service record
> gets registered via send_req_w4_rsp which seems to be null-byte safe.
> However, when someone queries the record, the string element is again
> truncated which seems to happen in the sdp_gen_pdu() function in
> sdp/sdp.c [of bluez-libs-2.17], l. 686, where strlen() is used to
> determine the string element's length. Would it be possible to use
> d->unitSize in this place instead?

it is fine to use unitSize. Send in a patch for both problems.

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-27  5:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-26 22:07 [Bluez-devel] null bytes in 'SDP_TEXT_STR8' data element Raimund Steger
2005-06-27  5:50 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.