Skip to content
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

Merged

Conversation

gilles-peskine-arm
Copy link
Contributor

Straightforward backport of the applicable parts of ARMmbed/mbed-crypto#349 and #2995

@gilles-peskine-arm gilles-peskine-arm added bug mbed TLS team needs-review Every commit must be reviewed by at least two team members, labels Jan 22, 2020
Copy link
Contributor

@mpg mpg left a 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:

  1. The backported commits are faithful to the original commits.
  2. The commits that are not backported are not relevant to this branch.
  3. 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

@@ -431,6 +431,15 @@ int execute_tests( int argc , const char ** argv )
return( 1 );
}

if( outcome_file_name != NULL )
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@mpg mpg added needs-work needs-ci Needs to pass CI tests labels Jan 27, 2020
Copy link
Contributor

@mpg mpg left a 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.

Copy link
Contributor

@yanesca yanesca left a 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.)

@yanesca yanesca removed needs-ci Needs to pass CI tests needs-review Every commit must be reviewed by at least two team members, labels Jan 28, 2020
@mpg mpg added the approved Design and code approved - may be waiting for CI or backports label Jan 29, 2020
yanesca added a commit that referenced this pull request Jan 29, 2020
@yanesca yanesca merged commit 75aab52 into Mbed-TLS:mbedtls-2.16 Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants