Skip to content

[Coverity CID :215712] Assignment of overlapping memory in lib/os/cbprintf_complete.c #31646

@zephyrbot

Description

@zephyrbot

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/f91e9fba51e5da46ee5c6822f8656713d74a6ecf/lib/os/cbprintf_complete.c#L1611

Category: Memory - corruptions
Function: cbvprintf
Component: Other
CID: 215712

Details:

1605                 }
1606    
1607                 if (value->sint < 0) {
1608                     sign = '-';
1609                     value->uint = (uint_value_type)-value->sint;
1610                 } else {
>>>     CID 215712:  Memory - corruptions  (OVERLAPPING_COPY)
>>>     Assigning "value->sint" to "value->uint", which have overlapping memory locations and different types.
1611                     value->uint = (uint_value_type)value->sint;
1612                 }
1613    
1614                 __fallthrough;
1615             case 'o':
1616             case 'u':

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.

Metadata

Metadata

Assignees

Labels

CoverityA Coverity detected issue or its fixbugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions