-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Backport 2.16: Fix minor defects found by Coverity #3001
Backport 2.16: Fix minor defects found by Coverity #3001
Conversation
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.
I reviewed with the following criteria in mind:
- The backported commits are faithful to the original commits.
- The commits that are not backported are not relevant to this branch.
- The commits that are backported are relevant to this branch.
I'm happy with respect to the first two criteria, but I think I found an issue regarding the third.
For the record, here's my reasoning regarding excluded commits:
- fix file leak in program: 2.16 doesn't have nss keylog in ssl_client2.c
- get_len_step: 2.16 doesn't have test_suite_asn1parse
- ASSERT_ALLOC_WEAK: 2.16 doesn't have that macro
tests/suites/host_test.function
Outdated
@@ -431,6 +431,15 @@ int execute_tests( int argc , const char ** argv ) | |||
return( 1 ); | |||
} | |||
|
|||
if( outcome_file_name != NULL ) |
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.
It seems to me that this file did not have any reference to outcome_file_name
in mbedtls-2.16 before thie PR, and the compiler would seem to agree:
suites/host_test.function: In function 'execute_tests':
suites/host_test.function:434:9: error: 'outcome_file_name' undeclared (first use in this function)
if( outcome_file_name != NULL )
Should this commit be skipped in the 2.16 backport?
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.
Indeed. CI also rejects this commit. I force-pushed a new history without that commit.
Check the value only once, as soon as we've obtained it.
7f2b966
to
75aab52
Compare
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.
The for removing the offending commit. Looks good to me now.
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.
Looks good to me.
(A minor addition to the reasoning: 2.16 does not have outcome file either in the tests, therefore we don't need 'Fix outcome file leak if execute_tests exits early' here.)
Straightforward backport of the applicable parts of ARMmbed/mbed-crypto#349 and #2995