Skip to content

Commit

Permalink
Fix uninitialized variable in x509_crt
Browse files Browse the repository at this point in the history
This patch fixes an issue we encountered with more stringent compiler
warnings.  The signature_is_good variable has a possibility of being
used uninitialized.  This patch moves the use of the variable to a
place where it cannot be used while uninitialized.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
  • Loading branch information
Andy Gross committed Feb 11, 2019
1 parent fb1972d commit 67b895e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Bugfix
hang.
* Clarify documentation of mbedtls_ssl_set_own_cert() regarding the absence
of check for certificate/key matching. Reported by Attila Molnar, #507.
* Fix compiler warning in x509_crt. Discovered and fixed by
Andy Gross (Linaro), #2392.

= mbed TLS 2.14.1 branch released 2018-11-30

Expand Down
10 changes: 4 additions & 6 deletions library/x509_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2088,15 +2088,13 @@ static int x509_crt_find_parent_in(
continue;
}

break;
}

if( parent != NULL )
{
*r_parent = parent;
*r_signature_is_good = signature_is_good;

break;
}
else

if( parent == NULL )
{
*r_parent = fallback_parent;
*r_signature_is_good = fallback_signature_is_good;
Expand Down

0 comments on commit 67b895e

Please sign in to comment.