]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: log: improper behavior when escaping log data
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 20 Sep 2022 12:33:18 +0000 (14:33 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Sep 2022 14:25:30 +0000 (16:25 +0200)
commitc5bff8e550cf49b0cb3a7abb998b2c915323eca9
treedb09418db75dd61889e8846564d9a2cfd889d2ae
parentb0b8e9bbd2b720ed2aff469d0989ce00876007dc
BUG/MINOR: log: improper behavior when escaping log data

Patrick Hemmer reported an improper log behavior when using
log-format to escape log data (+E option):
Some bytes were truncated from the output:

- escape_string() function now takes an extra parameter that
  allow the caller to specify input string stop pointer in
  case the input string is not guaranteed to be zero-terminated.
- Minors checks were added into lf_text_len() to make sure dst
  string will not overflow.
- lf_text_len() now makes proper use of escape_string() function.

This should be backported as far as 1.8.
include/haproxy/tools.h
src/log.c
src/tools.c