BUG/MINOR: sample: check alloc_trash_chunk return value in concat()
authorWilliam Dauchy <wdauchy@gmail.com>
Mon, 11 Jan 2021 10:05:58 +0000 (11:05 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 Jan 2021 11:07:05 +0000 (12:07 +0100)
commit22c43367210777a93c0ca311952cf7a7c946a6fc
tree7dc881a0cf1c5a793ed1428c18a7296565fd64b6
parent9da7aab15d2446e76342ad8a8045b13622164a6b
BUG/MINOR: sample: check alloc_trash_chunk return value in concat()

like it is done in other places, check the return value of
`alloc_trash_chunk` before using it. This was detected by coverity.

this patch fixes commit 591fc3a330005c289b4705fe4cb37c4eec9f9eed
("BUG/MINOR: sample: fix concat() converter's corruption with non-string
variables"
As a consequence, this patch should be backported as far as 2.0

this should fix github issue #1039

Signed-off-by: William Dauchy <wdauchy@gmail.com>
(cherry picked from commit e997010accdb17e70b628bc1e7c2810487d279c0)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit c9656833cf765782c043f6d7b902350178a984a6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit fb12e1b14323f1f68fca89b27d0cea76b1664e4b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/sample.c