Skip to content

fix build with hardening#4

Open
PlushBeaver wants to merge 1 commit intoMarvellEmbeddedProcessors:musdk-release-SDK-10.3.5.0-PR2from
PlushBeaver:fix-hardened
Open

fix build with hardening#4
PlushBeaver wants to merge 1 commit intoMarvellEmbeddedProcessors:musdk-release-SDK-10.3.5.0-PR2from
PlushBeaver:fix-hardened

Conversation

@PlushBeaver
Copy link

Fix GCC 10 warnings with -D_FORTIFY_SOURCE=2 and -Werror.

-Wstringop-overflow witn inet_aton(): true positive.
Give strncpy() space to put the terminating '\0'.

-Wstringop-overflow with json_print_to_buffer(): false positive.
Use strcpy() instead of strncpy() giving the warning,
because the size of the buffer is checked explicitly.

-Wunused-result with system(), fgets(), write(): true positive.
Check the result and print an error. No control flow change.

Signed-off-by: Dmitry Kozlyuk dmitry.kozliuk@gmail.com

Fix GCC 10 warnings with -D_FORTIFY_SOURCE=2 and -Werror.

-Wstringop-overflow witn inet_aton(): true positive.
    Give strncpy() space to put the terminating '\0'.

-Wstringop-overflow with json_print_to_buffer(): false positive.
    Use strcpy() instead of strncpy() giving the warning,
    because the size of the buffer is checked explicitly.

-Wunused-result with system(), fgets(), write(): true positive.
    Check the result and print an error. No control flow change.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant