public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/4] Fix an allocation oversight in SDP parsing
@ 2023-11-03 18:21 Jonas Dreßler
  2023-11-03 18:21 ` [PATCH BlueZ 1/4] lib/sdp: Allocate strings in sdp_data_t with NULL termination Jonas Dreßler
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Jonas Dreßler @ 2023-11-03 18:21 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: zbrown, Jonas Dreßler

There's fairly old oversight in the SDP parsing code where it was forgotten to
add a NULL termination byte to strings that are later handled using strlen().

This series fixes that oversight, with a few commits to better follow best
practices on top.

Found by running with address sanitizer.

Jonas Dreßler (4):
  lib/sdp: Allocate strings in sdp_data_t with NULL termination
  lib/sdp: Don't assume uint8_t has size 1
  lib/sdp: Use correct string length in sdp_copy_seq()
  lib/sdp: Pass size_t to sdp_get_string_attr()

 lib/sdp.c     | 15 ++++++++-------
 lib/sdp_lib.h | 14 +++++++-------
 2 files changed, 15 insertions(+), 14 deletions(-)

-- 
2.41.0


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

end of thread, other threads:[~2023-11-13 19:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-03 18:21 [PATCH BlueZ 0/4] Fix an allocation oversight in SDP parsing Jonas Dreßler
2023-11-03 18:21 ` [PATCH BlueZ 1/4] lib/sdp: Allocate strings in sdp_data_t with NULL termination Jonas Dreßler
2023-11-03 20:27   ` Fix an allocation oversight in SDP parsing bluez.test.bot
2023-11-03 18:21 ` [PATCH BlueZ 2/4] lib/sdp: Don't assume uint8_t has size 1 Jonas Dreßler
2023-11-03 18:21 ` [PATCH BlueZ 3/4] lib/sdp: Use correct string length in sdp_copy_seq() Jonas Dreßler
2023-11-03 18:21 ` [PATCH BlueZ 4/4] lib/sdp: Pass size_t to sdp_get_string_attr() Jonas Dreßler
2023-11-13 19:22 ` [PATCH BlueZ 0/4] Fix an allocation oversight in SDP parsing patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox