[openssl-commits] [openssl] master update

paul.dale at oracle.com paul.dale at oracle.com
Tue Aug 22 04:14:16 UTC 2017


The branch master has been updated
       via  932c0df29b7a5a2902c52e2f536b5b83392e2d42 (commit)
      from  9c481c2fdcbea3015f17fc5d5be8ed4a31811504 (commit)


- Log -----------------------------------------------------------------
commit 932c0df29b7a5a2902c52e2f536b5b83392e2d42
Author: Pauli <paul.dale at oracle.com>
Date:   Tue Aug 22 13:05:30 2017 +1000

    Avoid a self-assignment.
    
    Clang is generating a warning over an assignment of a variable to itself.
    This occurs on an ASCII based machine where the convert to ASCII macro doesn't
    do anything.  The fix is to introduce a temporary variable.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4214)

-----------------------------------------------------------------------

Summary of changes:
 crypto/ctype.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/ctype.c b/crypto/ctype.c
index 89ed5bf..588c6da 100644
--- a/crypto/ctype.c
+++ b/crypto/ctype.c
@@ -251,9 +251,9 @@ int ossl_fromascii(int c)
 int ossl_ctype_check(int c, unsigned int mask)
 {
     const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
+    const int a = ossl_toascii(c);
 
-    c = ossl_toascii(c);
-    return c >= 0 && c < max && (ctype_char_map[c] & mask) != 0;
+    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
 }
 
 #if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)


More information about the openssl-commits mailing list