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

polarssl-1.3.2/library/x509_crt.c:1276: 2 * possible bad if test ? #38

Closed
dcb314 opened this issue Nov 15, 2013 · 1 comment
Closed

Comments

@dcb314
Copy link

dcb314 commented Nov 15, 2013

I just compiled polarssl-1.3.2 with Linux gcc compiler flag -Wlogical-op.
It said

polarssl-1.3.2/library/x509_crt.c:1276:9: warning: logical 'or' of collectively exhaustive tests is always true [-Wlogical-op]
polarssl-1.3.2/library/x509_crt.c:1279:9: warning: logical 'or' of collectively exhaustive tests is always true [-Wlogical-op]

Source code is

    if( ( n1[i] >= 'a' || n1[i] <= 'z' ) && ( diff == 0 || diff == 32 ) )
        continue;

    if( ( n1[i] >= 'A' || n1[i] <= 'Z' ) && ( diff == 0 || diff == 32 ) )
        continue;

Suggest swap || for && in the a..z checks.

@pjbakker
Copy link
Contributor

Thanks for the report. A bit more was 'wrong'. No impact for current use.
Fixed in our branch for the next release.

gilles-peskine-arm pushed a commit to gilles-peskine-arm/mbedtls that referenced this issue Jan 18, 2021
…-1.0-beta-docs

API specifications at version 1.0 beta1
valeriosetti pushed a commit to valeriosetti/mbedtls that referenced this issue Dec 5, 2024
…ppers_fix_identation

c_wrapper_generator: Increased robustness of whitespace capture.
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