linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-devel] bug in sdp_gen_pd
@ 2006-06-06 10:25 Rafael Espíndola
  2006-06-07 21:10 ` Marcel Holtmann
  0 siblings, 1 reply; 17+ messages in thread
From: Rafael Espíndola @ 2006-06-06 10:25 UTC (permalink / raw)
  To: bluez-devel

In sdp_gen_pd when handling SDP_TEXT_STR{8,16,32}, data_size is assumed to be
"d->unitSize - sizeof(uint8_t)". This is false.

In sdp_data_alloc_with_length, d->unitSize is defined to be
sizeof(unit8_t) + length + sizeof(uint8_t) if length <= UCHAR_MAX
or
sizeof(unit8_t) + length + sizeof(uint16_t) if length > UCHAR_MAX

The attached patch fixes sdp_gen_pdu to correctly compute data_size.

Another strange thing in sdp_data_alloc_with_length: after adjusting
unitSize, the dtd variable is changed from SDP_*_STR8 to SDP_*_STR16
or the other way around. But this code is dead, since the dtd variable
is no longer used in this function.

Best Regards,
Rafael


_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Bluez-devel] bug in sdp_gen_pd
@ 2006-06-06 14:14 Rafael Espíndola
  0 siblings, 0 replies; 17+ messages in thread
From: Rafael Espíndola @ 2006-06-06 14:14 UTC (permalink / raw)
  To: bluez-devel, ulissesf@gmail.com

In sdp_gen_pd when handling SDP_TEXT_STR{8,16,32}, data_size is assumed to be
"d->unitSize - sizeof(uint8_t)". This is false.

In sdp_data_alloc_with_length, d->unitSize is defined to be
sizeof(unit8_t) + length + sizeof(uint8_t) if length <= UCHAR_MAX
or
sizeof(unit8_t) + length + sizeof(uint16_t) if length > UCHAR_MAX

The attached patch fixes sdp_gen_pdu to correctly compute data_size.

Another strange thing in sdp_data_alloc_with_length: after adjusting
unitSize, the dtd variable is changed from SDP_*_STR8 to SDP_*_STR16
or the other way around. But this code is dead, since the dtd variable
is no longer used in this function.

Best Regards,
Rafael


_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

end of thread, other threads:[~2006-06-26 12:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-06 10:25 [Bluez-devel] bug in sdp_gen_pd Rafael Espíndola
2006-06-07 21:10 ` Marcel Holtmann
2006-06-07 21:59   ` Rafael Espíndola
2006-06-07 22:11     ` Marcel Holtmann
2006-06-08 17:07       ` Rafael Espíndola
2006-06-09 20:14         ` Marcel Holtmann
2006-06-12  8:01           ` Marcel Holtmann
2006-06-12 11:52             ` Rafael Espíndola
2006-06-19 11:07               ` Marcel Holtmann
2006-06-19 12:13                 ` Rafael Espíndola
2006-06-19 12:17                   ` Rafael Espíndola
2006-06-19 17:38                     ` Rafael Espíndola
2006-06-19 18:07                       ` Marcel Holtmann
2006-06-19 20:21                         ` Rafael Espíndola
2006-06-20  7:17                           ` Marcel Holtmann
2006-06-26 12:49                       ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2006-06-06 14:14 Rafael Espíndola

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).