]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: tools: fix statistical_prng_range()'s output range
authorWilly Tarreau <w@1wt.eu>
Mon, 18 Jul 2022 17:09:55 +0000 (19:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 18 Jul 2022 17:09:55 +0000 (19:09 +0200)
commit03f3049df167069f1bf802c18c275524c346513c
tree7a7029f13106adf73d2945ad75edc50470c3125d
parent4348232231f8ac652c166c5cf49e5024fac40751
BUG/MINOR: tools: fix statistical_prng_range()'s output range

This function was added by commit 84ebfabf7 ("MINOR: tools: add
statistical_prng_range() to get a random number over a range") but it
contains a bug on the range, since mul32hi() covers the whole input
range, we must pass it range-1. For now it didn't have any impact, but
if used to find an array's index it will cause trouble.

This should be backported to 2.4.
include/haproxy/tools.h