Hi all,
Just a simple one, I've found that if you set the stick-table expire value
greater than the maximum value allowed ( The docs say ~24.85 days)
everything appears to work but clients are not added to the stick table.
It is a high value to use but it would be nicer if this was caught to stop
any undesired behaviour.
Attached is a suggested fix.

Regards,

Ben
From c4100ffc1bb530bbf1601bc92154d0e498eea111 Mon Sep 17 00:00:00 2001
From: Ben Cabot <[email protected]>
Date: Wed, 20 Jan 2016 09:44:39 +0000
Subject: [PATCH] BUG/MINOR: Adding validation to stick-table expire value. If
 the expire value exceedes the maximum value clients are not added to the
 stick table.

---
 src/cfgparse.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/cfgparse.c b/src/cfgparse.c
index efbf10d..bc97765 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -3964,6 +3964,12 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
 					err_code |= ERR_ALERT | ERR_FATAL;
 					goto out;
 				}
+				if (val > INT_MAX) {
+                                        Alert("parsing [%s:%d] : Expire value [%u]ms exceeds maxmimum value of 24.85 days.\n",
+                                                file, linenum, val);
+                                        err_code |= ERR_ALERT | ERR_FATAL;
+                                        goto out;
+                                }
 				curproxy->table.expire = val;
 				myidx++;
 			}
-- 
1.9.1

Reply via email to