-
Notifications
You must be signed in to change notification settings - Fork 105
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
Changes for passing the Coverity Static Analysis #314
base: main
Are you sure you want to change the base?
Conversation
There is some issue with the coverage report. Working on that. |
const size_t vecLen = pVec->vectorLen; | ||
size_t index = 0; | ||
size_t i = 0; | ||
|
||
for( i = 0; i < vecLen; i++ ) | ||
{ | ||
memcpy( &pAllocatedMem[ index ], pTransportVec[ i ].iov_base, pTransportVec[ i ].iov_len ); | ||
( void ) memcpy( &pAllocatedMem[ index ], ( const uint8_t * ) pTransportVec[ i ].iov_base, pTransportVec[ i ].iov_len ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Since memcpy's signature is: void* memcpy( void *dest, const void *src, size_t count );
wouldn't it be better to cast it to void
/const void
pointers.
For example, we do it like this in +TCP: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/source/FreeRTOS_DNS_Parser.c#L698-L704
Description
Make required changes for passing the Coverity Static Analysis. Unit tests are modified for the changes made.
Checklist:
Related Issue
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.