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/09/09 21:57:03 UTC

svn commit: r1893197 - in /apr/apr/branches/1.7.x: ./ tables/apr_tables.c

Author: ylavic
Date: Thu Sep  9 21:57:03 2021
New Revision: 1893197

URL: http://svn.apache.org/viewvc?rev=1893197&view=rev
Log:
Merge r1892618 from trunk:

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'.

Submitted by: ylavic

Modified:
    apr/apr/branches/1.7.x/   (props changed)
    apr/apr/branches/1.7.x/tables/apr_tables.c

Propchange: apr/apr/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1892618

Modified: apr/apr/branches/1.7.x/tables/apr_tables.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.7.x/tables/apr_tables.c?rev=1893197&r1=1893196&r2=1893197&view=diff
==============================================================================
--- apr/apr/branches/1.7.x/tables/apr_tables.c (original)
+++ apr/apr/branches/1.7.x/tables/apr_tables.c Thu Sep  9 21:57:03 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