]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: log: improper NULL return check on utoa_pad()
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 00:18:16 +0000 (01:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 15:19:18 +0000 (16:19 +0100)
commit9e60cd84b7fef86bacf93212e329453d35549b01
tree6920a7ffd7b09cfbea5aba844d7c46005aa68710
parente95c4ce1b7c925debf4c9b7c794f3b6765edef88
BUG/MINOR: log: improper NULL return check on utoa_pad()

utoa_pad() is directly fed into tmplog, which is checked for NULL.
First, when NULLs are possible, they should be put into a temp variable
in order to preserve tmplog, and second, this return value can never be
NULL because the value passed is tv_usec/1000 (between "0" and "999")
with a 4-char output. However better fix the check in case this code gets
improperly copy-pasted for another usage later.

Reported-by: Dinko Korunic <dkorunic@reflected.net>
src/log.c