package: haproxy
[openwrt/svn-archive/archive.git] / net / haproxy / patches / 0027-BUG-MEDIUM-checks-ensure-the-health_status-is--1.4.22.diff
1 From 9e98076edc9d3f25763473480e4aac6223bfd7d0 Mon Sep 17 00:00:00 2001
2 From: Willy Tarreau <w@1wt.eu>
3 Date: Thu, 24 Jan 2013 00:37:39 +0100
4 Subject: BUG/MEDIUM: checks: ensure the health_status is always within bounds
5
6 health_adjust() checks for incorrect bounds for the status argument.
7 With current code, the argument is always a constant from the valid
8 enum so there is no impact and the check is basically a NOP. However
9 users running local patches (eg: new checks) might want to recheck
10 their code.
11
12 This fix should be backported to 1.4 which introduced the issue.
13
14 Reported-by: Dinko Korunic <dkorunic@reflected.net>
15 (cherry picked from commit bb95666bac94b6235eda431aba788644f7de7a3f)
16 ---
17 src/checks.c | 2 +-
18 1 files changed, 1 insertions(+), 1 deletions(-)
19
20 diff --git a/src/checks.c b/src/checks.c
21 index 201900a..13b5c64 100644
22 --- a/src/checks.c
23 +++ b/src/checks.c
24 @@ -584,7 +584,7 @@ void health_adjust(struct server *s, short status) {
25 if (s->observe >= HANA_OBS_SIZE)
26 return;
27
28 - if (status >= HCHK_STATUS_SIZE || !analyze_statuses[status].desc)
29 + if (status >= HANA_STATUS_SIZE || !analyze_statuses[status].desc)
30 return;
31
32 switch (analyze_statuses[status].lr[s->observe - 1]) {
33 --
34 1.7.1
35