BUG/MINOR: stick-table: Always call smp_fetch_src() with a valid arg list
The sample fetch functions must always be called with a valid argument
list. When called by hand, if there is no argument to pass, empty_arg_list must
be used.
In the stick-table code, there are some calls to smp_fetch_src() with NULL as
argument list. It is changed to use empty_arg_list instead. It is not really a
bug because smp_fetch_src() does not use the argument list. But it is an API
bug.
This patch may be backported to all stable branches as a cleanup.
(cherry picked from commit bdbd5db2a50461fceb7fb89329e73d08f90e44fd)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 1945529933f00a37383990035d7257020efef520)
[cf: context adjustments]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 8e720d0fb09c93ca45076ccb23aa11e268ca0e16)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit d7fbc2e493e9a9f137fa1ffc5dfb4c23d2c0ffd7)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/stick_table.c b/src/stick_table.c
index 86aaedf..689f149 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -2167,7 +2167,7 @@
smp.px = NULL;
smp.sess = sess;
smp.strm = strm;
- if (!smp_fetch_src(NULL, &smp, NULL, NULL))
+ if (!smp_fetch_src(empty_arg_list, &smp, NULL, NULL))
return NULL;
/* Converts into key. */
@@ -2232,7 +2232,7 @@
smp.px = NULL;
smp.sess = sess;
smp.strm = strm;
- if (!smp_fetch_src(NULL, &smp, NULL, NULL))
+ if (!smp_fetch_src(empty_arg_list, &smp, NULL, NULL))
return NULL;
/* Converts into key. */
@@ -2764,7 +2764,7 @@
return 0;
/* Fetch source address in a sample. */
- if (!smp_fetch_src(NULL, smp, NULL, NULL))
+ if (!smp_fetch_src(empty_arg_list, smp, NULL, NULL))
return 0;
/* Converts into key. */