BUG/MINOR: pattern: a sample marked as const could be written

The functions add final 0 to string if the final 0 is not set,
but don't check the flag CONST. This patch duplicates the strings
if the final zero is not set and the string is CONST.

Should be backported until 2.2 (at least)

(cherry picked from commit a68affeaa9377f88f773ef62a9bb2541dfb672d3)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 9633f444ac3ae540f6ce5dd0b0880fb40fabe9d5)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit b982485900e4f20f9c4a0ef2521da1c223acb30d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 641c089992cad2c654d593200ae197010a725fe6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed