]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix "left shift cannot be represented in type 'int'" in hello_ext.[ch]
authorTim Rühsen <tim.ruehsen@gmx.de>
Fri, 20 Dec 2019 10:00:53 +0000 (11:00 +0100)
committerTim Rühsen <tim.ruehsen@gmx.de>
Fri, 3 Jan 2020 10:34:37 +0000 (11:34 +0100)
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
lib/hello_ext.c
lib/hello_ext.h

index 33eaa27b108b6e3e7ad95290e53d29a5d7315e9a..0c6c0dca01d2316fe01e46b25d0b2d6de4327b83 100644 (file)
@@ -520,7 +520,7 @@ int _gnutls_hello_ext_pack(gnutls_session_t session, gnutls_buffer_st *packed)
        BUFFER_APPEND_NUM(packed, 0);
 
        for (i = 0; i <= GNUTLS_EXTENSION_MAX_VALUE; i++) {
-               if (session->internals.used_exts & (1<<i)) {
+               if (session->internals.used_exts & (1U << i)) {
 
                        ext = gid_to_ext_entry(session, i);
                        if (ext == NULL)
index f2dfd7ff6a33063283f8d3c6f4612dbfaec3523c..38b28ae069ea1208b4860353b88f8350a02847db 100644 (file)
@@ -160,7 +160,7 @@ typedef struct hello_ext_entry_st {
 inline static unsigned
 _gnutls_hello_ext_is_present(gnutls_session_t session, extensions_t id)
 {
-       if ((1 << id) & session->internals.used_exts)
+       if (session->internals.used_exts & (1U << id))
                return 1;
 
        return 0;
@@ -184,7 +184,7 @@ unsigned _gnutls_hello_ext_save(gnutls_session_t session,
                        return 0;
        }
 
-       session->internals.used_exts |= (1 << id);
+       session->internals.used_exts |= (1U << id);
 
        return 1;
 }