You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2021/08/26 12:33:10 UTC

svn commit: r1892618 - /apr/apr/trunk/tables/apr_tables.c

Author: ylavic
Date: Thu Aug 26 12:33:10 2021
New Revision: 1892618

URL: http://svn.apache.org/viewvc?rev=1892618&view=rev
Log:
apr_tables: fix petential left shift of 31 on an int.

apr_tables.c:832:10: runtime error: left shift of 1 by 31 places cannot be
represented in type 'int'.

Modified:
    apr/apr/trunk/tables/apr_tables.c

Modified: apr/apr/trunk/tables/apr_tables.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/tables/apr_tables.c?rev=1892618&r1=1892617&r2=1892618&view=diff
==============================================================================
--- apr/apr/trunk/tables/apr_tables.c (original)
+++ apr/apr/trunk/tables/apr_tables.c Thu Aug 26 12:33:10 2021
@@ -296,8 +296,8 @@ APR_DECLARE(char *) apr_array_pstrcat(ap
 #define TABLE_HASH_SIZE 32
 #define TABLE_INDEX_MASK 0x1f
 #define TABLE_HASH(key)  (TABLE_INDEX_MASK & *(unsigned char *)(key))
-#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1 << (i)))
-#define TABLE_SET_INDEX_INITIALIZED(t, i) ((t)->index_initialized |= (1 << (i)))
+#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1u << (i)))
+#define TABLE_SET_INDEX_INITIALIZED(t, i) ((t)->index_initialized |= (1u << (i)))
 
 /* Compute the "checksum" for a key, consisting of the first
  * 4 bytes, normalized for case-insensitivity and packed into