mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-08 18:36:18 -04:00
MINOR: stats-file: use explicit unsigned integer bitshift for user slots
As reported in GH #3104, there remained a place where (1 << shift was used to set or remove bits from uint64_t users bitfield. It is incorrect and could lead to bugs for values > 32 bits. Instead, let's use 1ULL to ensure the operation remains 64bits consistent. No backport needed.
This commit is contained in:
parent
9272b8ce74
commit
b9ef55d56d
1 changed files with 1 additions and 1 deletions
|
|
@ -566,7 +566,7 @@ static struct shm_stats_file_object *shm_stats_file_reuse_object(void)
|
|||
free = 1; // consider all users are inactive for now
|
||||
|
||||
while (slot < sizeof(shm_stats_file_hdr->slots) / sizeof(shm_stats_file_hdr->slots[0])) {
|
||||
if ((users & (1 << slot)) &&
|
||||
if ((users & (1ULL << slot)) &&
|
||||
!shm_stats_file_slot_isfree(shm_stats_file_hdr, slot)) {
|
||||
/* user still alive, so supposedly making use of it */
|
||||
free = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue