[glib: 1/2] ghash: Fix out-of-range use of signed integer



commit d3074a748fd5256eece01066d28c868f45b40359
Author: Hans Petter Jansson <hpj cl no>
Date:   Fri Oct 12 13:09:39 2018 +0200

    ghash: Fix out-of-range use of signed integer
    
    We were mistakenly shifting a signed int literal by up to 31 places.
    Specify unsigned int instead.
    
    Closes #1570

 glib/ghash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/ghash.c b/glib/ghash.c
index d305530a8..af79f5b67 100644
--- a/glib/ghash.c
+++ b/glib/ghash.c
@@ -691,7 +691,7 @@ get_status_bit (const guint32 *bitmap, guint index)
 static inline void
 set_status_bit (guint32 *bitmap, guint index)
 {
-  bitmap[index / 32] |= 1 << (index % 32);
+  bitmap[index / 32] |= 1U << (index % 32);
 }
 
 /* By calling dedicated resize functions for sets and maps, we avoid 2x


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]