From: Christopher Faulet Date: Thu, 9 Nov 2017 15:14:16 +0000 (+0100) Subject: BUG/MINOR: pattern: Rely on the sample type to copy it in pattern_exec_match X-Git-Tag: v1.8-rc3~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09fdf4b1122670a0ecb86f100aa84353453e7474;p=thirdparty%2Fhaproxy.git BUG/MINOR: pattern: Rely on the sample type to copy it in pattern_exec_match To be thread safe, the function pattern_exec_match copy data (the pattern and the inner sample) in thread-local variables. But when the sample is duplicated, we must check its type and not the pattern one. This is specific to threads, no backport is needed. --- diff --git a/src/pattern.c b/src/pattern.c index 39ecd9517b..47e8aeeb8d 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -2592,7 +2592,7 @@ struct pattern *pattern_exec_match(struct pattern_head *head, struct sample *smp /* We also duplicate the sample data for same reason */ if (pat->data && (pat->data != &static_sample_data)) { - switch(pat->type) { + switch(pat->data->type) { case SMP_T_STR: static_sample_data.type = SMP_T_STR; static_sample_data.u.str = *get_trash_chunk();