mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-09 15:30:17 +00:00
BUG/MINOR: log: junk at the end of syslog packet
With a facily of 2 or 1 digit, the send size was wrong and bytes with unknown value were sent. The size was calculated using the start of the buffer and not the start of the data which varies with the number of digits of the facility. This bug was reported by Samuel Stoller and reported by Lukas Tribus.
This commit is contained in:
parent
5b7ea3afa1
commit
afeb987c5c
@ -847,7 +847,7 @@ void __send_log(struct proxy *p, int level, char *message, size_t size)
|
||||
} while (fac_level && log_ptr > dataptr);
|
||||
*log_ptr = '<';
|
||||
|
||||
sent = sendto(*plogfd, log_ptr, size + log_ptr - dataptr,
|
||||
sent = sendto(*plogfd, log_ptr, size - (log_ptr - dataptr),
|
||||
MSG_DONTWAIT | MSG_NOSIGNAL,
|
||||
(struct sockaddr *)&logsrv->addr, get_addr_len(&logsrv->addr));
|
||||
if (sent < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user