BUG/MINOR threads: Use get_(local|gm)time instead of (local|gm)time
authorTim Duesterhus <tim@bastelstu.be>
Sat, 28 Aug 2021 21:57:01 +0000 (23:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 3 Sep 2021 14:29:08 +0000 (16:29 +0200)
commit1ee21943ae572bcd9b54353ce2ceed5cb31e6332
treecddabb3aa86e9ce75fcd605fe66e99c2920d9e92
parent84ae6a917f44d8c7470c1d650d8a077eeb68166f
BUG/MINOR threads: Use get_(local|gm)time instead of (local|gm)time

Using localtime / gmtime is not thread-safe, whereas the `get_*` wrappers are.

Found using GitHub's CodeQL scan.

The use in sample_conv_ltime() can be traced back to at least
fac9ccfb705702f211f99e67d5f5d5129002086a (first appearing in 1.6-dev3), so all
supported branches with thread support are affected.

(cherry picked from commit 1f269c12dc31bb63db31559cb44c187ab91abb64)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 9da4b1fc83fe083c8f194c61402ba4ffeb5b330c)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/http_conv.c
src/sample.c