Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.7: Bluetooth: TBS: TBS client may return NULL instead of the empty string in callbacks #84148

Open
Thalley opened this issue Jan 17, 2025 · 1 comment
Assignees
Labels
area: Bluetooth Audio area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@Thalley
Copy link
Collaborator

Thalley commented Jan 17, 2025

Describe the bug
If the TBS client receives an empty value when reading a string, it treated that as NULL, but since empty strings are still strings, it should simply treat it as such, and provide "\0" instead. The callbacks are documented to return strings.

To Reproduce
Steps to reproduce the behavior:

  1. Build and flash the https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/bluetooth/tmap_peripheral from the 3.7 branch
  2. Connect a Android 15 phone to the sample
  3. See that URI list is empty when read but NULL provided to the callback

Expected behavior
Expect the TBS client to follow its documentation and always return a string when there's no read error.

Impact
Confused developers. The TMAP sample would call strlen and strncpy on a NULL value.

Logs and console output

CCP: Discovered GTBS
CCP: Discovered remote URI: �w
CCP initialized

Environment (please complete the following information):

  • OS: (e.g. Linux, MacOS, Windows)
  • Toolchain (e.g Zephyr SDK, ...)
  • Commit SHA or Version used: 1182a4c (v3.7-branch)

Additional context
N/A

@kartben
Copy link
Collaborator

kartben commented Jan 21, 2025

triaging as low due to impact being described as "confusion"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Audio area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
Status: To do
Development

No branches or pull requests

2 participants