diff --git a/src/proto_http.c b/src/proto_http.c index d566bcc81..01fe62d09 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -9748,6 +9748,9 @@ smp_prefetch_http(struct proxy *px, struct session *s, void *l7, unsigned int op return 1; } +/* Note: these functinos *do* modify the sample. Even in case of success, at + * least the type and uint value are modified. + */ #define CHECK_HTTP_MESSAGE_FIRST() \ do { int r = smp_prefetch_http(px, l4, l7, opt, args, smp, 1); if (r <= 0) return r; } while (0) diff --git a/src/sample.c b/src/sample.c index 9f22ef971..3a0f3fbbc 100644 --- a/src/sample.c +++ b/src/sample.c @@ -905,7 +905,7 @@ struct sample *sample_process(struct proxy *px, struct session *l4, void *l7, if (p == NULL) { p = &temp_smp; - p->flags = 0; + memset(p, 0, sizeof(*p)); } if (!expr->fetch->process(px, l4, l7, opt, expr->arg_p, p, expr->fetch->kw)) @@ -1160,7 +1160,8 @@ struct sample *sample_fetch_string(struct proxy *px, struct session *l4, void *l { struct sample *smp = &temp_smp; - smp->flags = 0; + memset(smp, 0, sizeof(*smp)); + if (!sample_process(px, l4, l7, opt, expr, smp)) { if ((smp->flags & SMP_F_MAY_CHANGE) && !(opt & SMP_OPT_FINAL)) return smp;