On Mon, 2009-03-09 at 11:32 -0300, Luiz Augusto von Dentz wrote: > Hi Bastien, > > On Mon, Mar 9, 2009 at 11:14 AM, Bastien Nocera wrote: > > Both use the code in common/sdp-xml.[ch] and convert_sdp_record_to_xml() > > in particular, which is why it makes no sense to me... > > > > I double-checked by adding some debug to convert_raw_data_to_xml() and > > the string for the attribute I'm interested in is empty, so it must be a > > problem parsing the raw data from the device, or there's something that > > strips this value somewhere in bluetoothd... > > Then I fear that my code of dumping an sdp record (sdp_copy_record) is > probably not copying the string correctly. Problem was sdp_data_alloc() falling back to doing an strlen() on the string, instead of taking its existing length into account. That would break any strings with NULLs embedded. The attached patch fixes this. I'm not certain that making this public is useful, but feel free to make it so if you feel it's needed. Cheers