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

[Coverity CID: 236603] Dereference after null check in subsys/bluetooth/audio/vcs_client.c #36303

Closed
zephyrbot opened this issue Jun 16, 2021 · 1 comment · Fixed by #35823
Closed
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/d25e5c20a07203443b2e9fafe30bf8eef852ed23/subsys/bluetooth/audio/vcs_client.c#L661

Category: Null pointer dereferences
Function: vocs_discover_cb
Component: Bluetooth
CID: 236603

Details:

vcs_client_cb->discover(vcs_inst->conn,

655         struct vcs_instance *vcs_inst = lookup_vcs_by_vocs(inst);
656    
657         if (vcs_inst == NULL) {
658             BT_ERR("Could not lookup vcs_inst from vocs");
659    
660             if (vcs_client_cb && vcs_client_cb->discover) {
>>>     CID 236603:  Null pointer dereferences  (FORWARD_NULL)
>>>     Dereferencing null pointer "vcs_inst".
661                 vcs_client_cb->discover(vcs_inst->conn,
662                             BT_GATT_ERR(BT_ATT_ERR_UNLIKELY),
663                             0, 0);
664             }
665    
666             return;

For more information about the violation, check the Coverity Reference. CWE-476

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v29271/p12996

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Jun 16, 2021
@Thalley
Copy link
Collaborator

Thalley commented Jun 24, 2021

Fixed by #35823

@Thalley Thalley closed this as completed Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants