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 :219543] Out-of-bounds access in samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/smp_svr.c #32906

Closed
zephyrbot opened this issue Mar 5, 2021 · 2 comments
Assignees
Labels
area: Bluetooth Mesh bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix platform: nRF Nordic nRFx 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/bd97359a5338b2542d19011b6d6aa1d8d1b9cc3f/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/smp_svr.c#L46

Category: Memory - corruptions
Function: smp_svr_init
Component: Samples
CID: 219543

Details:

rc = STATS_INIT_AND_REG(smp_svr_stats, STATS_SIZE_32, "smp_svr_stats");

40     STATS_SECT_DECL(smp_svr_stats) smp_svr_stats;
41    
42     void smp_svr_init(void)
43     {
44         int rc;
45    
>>>     CID 219543:  Memory - corruptions  (OVERRUN)
>>>     Overrunning struct type stats_hdr of 24 bytes by passing it to a function which accesses it at byte offset 24.
46         rc = STATS_INIT_AND_REG(smp_svr_stats, STATS_SIZE_32, "smp_svr_stats");
47         __ASSERT_NO_MSG(rc == 0);
48    
49         /* Register the built-in mcumgr command handlers. */
50     #ifdef CONFIG_MCUMGR_CMD_FS_MGMT
51         fs_mgmt_register_group();

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/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 Mar 5, 2021
@nashif nashif removed their assignment Mar 5, 2021
@galak galak added the platform: nRF Nordic nRFx label Mar 16, 2021
@galak
Copy link
Collaborator

galak commented Mar 16, 2021

@carlescufi can you assign this to the right person

@trond-snekvik
Copy link
Contributor

This is a false positive, as the passed stats_hdr structure is meant to be accessed out of bounds.

I am not able to put this in coverity though, as I still haven't been granted access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Mesh bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix platform: nRF Nordic nRFx priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants