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

Duplicated if( verbose != 0 ) #134

Closed
pavel-pimenov opened this issue Sep 18, 2014 · 1 comment
Closed

Duplicated if( verbose != 0 ) #134

pavel-pimenov opened this issue Sep 18, 2014 · 1 comment

Comments

@pavel-pimenov
Copy link

V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 2302, 2305. bignum.c 2305

if( verbose != 0 )
    polarssl_printf( "passed\n" );
if( verbose != 0 )
    polarssl_printf( "  MPI test #5 (simple gcd): " );

fix:
if( verbose != 0 ) {
polarssl_printf( "passed\n" );
polarssl_printf( " MPI test #5 (simple gcd): " );
}
or
if( verbose != 0 )
polarssl_printf( "passed\n MPI test #5 (simple gcd): " );

V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 522, 528. ctr_drbg.c 528
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 539, 542. ctr_drbg.c 542
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 1971, 1974. ecp.c 1974
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 771, 774. gcm.c 774
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 798, 801. gcm.c 801
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 865, 868. gcm.c 868
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 472, 478. hmac_drbg.c 478
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 491, 494. hmac_drbg.c 494
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 371, 374. timing.c 374
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 394, 397. timing.c 397
V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 419, 422. timing.c 422

@pjbakker
Copy link
Contributor

Technically the static analysis is right.

Practically, this is test code and the code reads cleaner the way it is written now.
I don't expect this to change in a future release.

mpg pushed a commit that referenced this issue Oct 30, 2018
…d_length

Fix bug in test_import_export with non-canonical input
hanno-becker pushed a commit to hanno-becker/mbedtls that referenced this issue Feb 1, 2021
…traffic_key_from_finished_out

Remove traffic_key from finished_out
iameli pushed a commit to livepeer/mbedtls that referenced this issue Dec 5, 2023
Prevent stack-buffer-overflow with gcc -fsanitize=address
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

No branches or pull requests

2 participants