-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Fix coverity issues in cbprintf and logging #35201
Merged
galak
merged 8 commits into
zephyrproject-rtos:master
from
nordic-krch:fix/coverity/cbprintf
May 13, 2021
Merged
Fix coverity issues in cbprintf and logging #35201
galak
merged 8 commits into
zephyrproject-rtos:master
from
nordic-krch:fix/coverity/cbprintf
May 13, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When immediate mode is used CONFIG_LOG_BUFFER_SIZE is not defined in kconfig. For proper compilation it is then defined in the test file. Use positive value to please coverity which complains about dead code when it is set to 0. Fixing CID 235961, 235965. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Coverity (CID 235987) complained about casting from double * to int *. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
nordic-krch
requested review from
carlescufi,
galak,
MaureenHelm and
nashif
as code owners
May 12, 2021 06:12
github-actions
bot
added
area: API
Changes to public APIs
area: Logging
area: Tests
Issues related to a particular existing or missing test
labels
May 12, 2021
There was an accidental early return in the test. Spotted by coverity CID 235986, 236006. Additionally, test had to be fixed because early returned covered issues. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added missing va_end. Reported by coverity CID 232501 Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Move assert check before array access to ensure that negative index is not used in an array. Coverity CID 222151. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Coverity CID 235911. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Mock backend is using 32 bytes for hexdump data and only hexdumps with less data shall be compared against expected one. Wrong operator was used and comparing was performed only when hexdump size exceeded 32 bytes. Spotted by Coverity CID 236015. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Arg can be double * and it is casted to int *. Coverity reports it (CID 235943). Fixed by adding intermediate void * variable. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
nordic-krch
force-pushed
the
fix/coverity/cbprintf
branch
from
May 12, 2021 08:53
64e8edf
to
484b401
Compare
nashif
approved these changes
May 12, 2021
MaureenHelm
approved these changes
May 12, 2021
dcpleung
approved these changes
May 12, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: API
Changes to public APIs
area: Base OS
Base OS Library (lib/os)
area: Logging
area: Tests
Issues related to a particular existing or missing test
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Set of fixes in cbprintf/logging code and tests.
Fixes #35116.
Fixes #35126.
Fixes #35127.
Fixes #35152.
Fixes #35153.
Fixes #35133.
Fixes #35134.
Fixes #35135.
Fixes #35148.
Fixes #35151.