From: Willy Tarreau Date: Sat, 2 Feb 2019 16:46:24 +0000 (+0100) Subject: BUG/MINOR: config: fix bind line thread mask validation X-Git-Tag: v2.0-dev1~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b4a39adc4f9f21dec00a118128f179ade698b17;p=thirdparty%2Fhaproxy.git BUG/MINOR: config: fix bind line thread mask validation When no nbproc is specified, a computation leads to reading bind_thread[-1] before checking if the thread mask is valid for a bind conf. It may either report a false warning and compute a wrong mask, or miss some incorrect configs. This must be backported to 1.9 and possibly 1.8. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 5c292f82d2..40a21e7841 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2288,9 +2288,9 @@ int check_config_validity() /* detect and address thread affinity inconsistencies */ nbproc = 0; if (bind_conf->bind_proc) - nbproc = my_ffsl(bind_conf->bind_proc); + nbproc = my_ffsl(bind_conf->bind_proc) - 1; - mask = bind_conf->bind_thread[nbproc - 1]; + mask = bind_conf->bind_thread[nbproc]; if (mask && !(mask & all_threads_mask)) { unsigned long new_mask = 0;