]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: samples: Fix handling of SMP_T_METH samples master
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 Apr 2026 19:00:00 +0000 (21:00 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 Apr 2026 20:05:12 +0000 (22:05 +0200)
commitb0a9216ca5375c076fd144db68365d7a9a41a161
tree5fdf292e0109478cfb9239eb5f5e02c0a12bccd8
parent265be7e8cbea03ecf19e016f5593e7067cc249e2
BUG/MEDIUM: samples: Fix handling of SMP_T_METH samples

Samples of type SMP_T_METH were not properly handled in smp_dup(),
smp_is_safe() and smp_is_rw(). For "other" methods, for instance PATCH, a
fallback was performed on the SMP_T_STR type. Only the buffer considered
changed. "smp->data.u.meth.str" should be used for the SMP_T_METH samples
while smp->data.u.str should be used for SMP_T_STR samples. However, in
smp_dup(), the result was stored in wrong buffer, the string one instead of
the method one. In smp_is_safe() and smp_is_rw(), the method buffer was not
used at all.

We now take care to use the right buffer.

This patch must be backported to all stable versions.
include/haproxy/sample.h
src/sample.c