mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
newsrv->curr_idle_thr is of type `unsigned int`, not `int`. Fix this issue by simply passing the dereferenced pointer to sizeof, which is the preferred style anyway. This bug was introduced in commit dc2f2753e97ecfe94827de56ee9efd2cd6d39ad3. It first appeared in 2.2-dev5. The patch must be backported to 2.2+. It is notable that the `calloc` call was not introduced within the commit in question. The allocation was already happening before that commit and it already looked like it does after applying the patch. Apparently the argument for the `sizeof` managed to get broken during the rearrangement that happened in that commit: for (i = 0; i < global.nbthread; i++) - MT_LIST_INIT(&newsrv->idle_orphan_conns[i]); - newsrv->curr_idle_thr = calloc(global.nbthread, sizeof(*newsrv->curr_idle_thr)); + MT_LIST_INIT(&newsrv->safe_conns[i]); + + newsrv->curr_idle_thr = calloc(global.nbthread, sizeof(int)); Even more notable is that I previously fixed that *exact same* allocation in commit 017484c80f2fd265281853fdf0bc816b19a751da. So apparently it was managed to break this single line twice in the same way for whatever reason there might be.
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)
Description
Languages
C
98.1%
Shell
0.8%
Makefile
0.5%
Lua
0.2%
Python
0.2%