BUG/MINOR: pattern: prevent const sample from being tampered in pat_match_beg()
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 6 Sep 2024 14:21:02 +0000 (16:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Sep 2024 17:44:33 +0000 (19:44 +0200)
commit1f06ee2f67d56fec623591f5fad4aa45f7a6ee10
treeb34bef597c487c01f9dfdc248138b46d44785998
parent4c656153b34b2105c1c89ab9437ee18567493e6a
BUG/MINOR: pattern: prevent const sample from being tampered in pat_match_beg()

This is a complementary patch to a68affeaa ("BUG/MINOR: pattern: a sample
marked as const could be written"). Indeed the same logic from
pat_match_str() is used there, but we lack the check to ensure that the
sample is not const before writing data to it.

It could be backported to all stable versions.

(cherry picked from commit 3449525a0204841a62a9fa41119ec8c47f21fde8)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/pattern.c