[bluez/bluez] fe0eb9: shared/util: Add strtoutf8 function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Branch: refs/heads/980101
  Home:   https://github.com/bluez/bluez
  Commit: fe0eb95831ebc43210a92fd5d850f52d27287f33
      https://github.com/bluez/bluez/commit/fe0eb95831ebc43210a92fd5d850f52d27287f33
  Author: Frédéric Danis <frederic.danis@xxxxxxxxxxxxx>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M src/shared/util.c
    M src/shared/util.h

  Log Message:
  -----------
  shared/util: Add strtoutf8 function

This adds the strtoutf8 function that truncate a string before the
first non UTF-8 character.
This truncation is done in place.


  Commit: 83fbfb7ad0e5231067d52354eedfbf9ba15dd51e
      https://github.com/bluez/bluez/commit/83fbfb7ad0e5231067d52354eedfbf9ba15dd51e
  Author: Frédéric Danis <frederic.danis@xxxxxxxxxxxxx>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M profiles/audio/avrcp.c

  Log Message:
  -----------
  audio/avrcp: Fix crash with invalid UTF-8 item name

As stated in AVRCP 1.6.2 chapter 6.10.2.3 Media element item, for the
Displayable Name Length property, the target device may truncate the
item name:

  Length of Displayable Name in octets. The name shall be limited such
  that a response to a GetFolderItems containing one media player item
  fits within the maximum size of PDU which can be received by the CT.

This truncatation may occur in the middle of a multi-byte character,
at least with Samsung Music app, which triggers a DBus assertion and
crashes bluetoothd:

  profiles/audio/player.c:media_folder_create_item() Din Dhal Jaye
      Haye with lyrics | "दिन ढल जाए
      हाय" गाने के बो� type audio uid 1
  profiles/audio/player.c:media_folder_create_item()
      /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
  profiles/audio/player.c:media_player_set_metadata() Title: Din Dhal
      Jaye Haye with lyrics | "दिन ढल जाए हाय"
      गाने के बोल | Guide | Dev Anand, Waheeda Rehman
  …
  arguments to dbus_message_iter_append_basic() were incorrect,
      assertion "_dbus_check_is_valid_utf8 (*string_p)" failed in
      file dbus-message.c line 2775.
  This is normally a bug in some application using the D-Bus library.


  Commit: f091098e5c0e9d1117683379a14effaa07616d71
      https://github.com/bluez/bluez/commit/f091098e5c0e9d1117683379a14effaa07616d71
  Author: Frédéric Danis <frederic.danis@xxxxxxxxxxxxx>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M profiles/audio/mcp.c

  Log Message:
  -----------
  audio/mcp: Use strtoutf8 for player name and track title

Truncate the string to first character before invalid UTF-8 one
instead of replacing non ascii characters by spaces.


  Commit: 4d04f4b3c7d56ea7fdfb3e17f47bf033a4f8b43b
      https://github.com/bluez/bluez/commit/4d04f4b3c7d56ea7fdfb3e17f47bf033a4f8b43b
  Author: Frédéric Danis <frederic.danis@xxxxxxxxxxxxx>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M profiles/gap/gas.c

  Log Message:
  -----------
  audio/gap: Use strtoutf8 for GAP device name

Truncate the string to first character before invalid UTF-8 one
instead of replacing non ascii characters by spaces.


  Commit: 53904d22aaec7723b800f93938ba2989585d9a19
      https://github.com/bluez/bluez/commit/53904d22aaec7723b800f93938ba2989585d9a19
  Author: Frédéric Danis <frederic.danis@xxxxxxxxxxxxx>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M src/eir.c

  Log Message:
  -----------
  eir: Use strtoutf8 for device names

Truncate the string to first character before invalid UTF-8 one
instead of replacing non ascii characters by spaces.


  Commit: 73b07a0b63ec3275abe93a722f4f0efcf165403f
      https://github.com/bluez/bluez/commit/73b07a0b63ec3275abe93a722f4f0efcf165403f
  Author: Frédéric Danis <frederic.danis@xxxxxxxxxxxxx>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M src/shared/ad.c

  Log Message:
  -----------
  shared/ad: Use strtoutf8 for name

Truncate the string to first character before invalid UTF-8 one
instead of replacing non ascii characters by spaces.


  Commit: 30d64214996e1ee0eaf8f0c9ad4a8df53be84aed
      https://github.com/bluez/bluez/commit/30d64214996e1ee0eaf8f0c9ad4a8df53be84aed
  Author: Frédéric Danis <frederic.danis@xxxxxxxxxxxxx>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M unit/test-eir.c

  Log Message:
  -----------
  unit/test-eir: Add name encoding tests

This ensures that device name encode with UTF-16, ISO-2022-JP or with
an incorrect character in UTF-8 string are truncated correctly.


Compare: https://github.com/bluez/bluez/compare/fe0eb95831eb%5E...30d64214996e

To unsubscribe from these emails, change your notification settings at https://github.com/bluez/bluez/settings/notifications





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux