In
ad0133cc ("MINOR: log: handle log-forward "option host""), we
de-reference saddr without first checking if saddr is NULL. In practise
saddr shouldn't be null, but it may be the case if memory error happens
for tcp syslog handler so we must assume that it can be NULL at some
point.
To fix the bug, we simply check for NULL before de-referencing it
under syslog_io_handler(), as the function comment suggests.
No backport needed unless
ad0133cc is.
parse_log_message(buf->area, buf->data, &level, &facility, metadata, &message, &size);
- if (real_family(saddr->ss_family) == AF_UNIX)
+ if (saddr && real_family(saddr->ss_family) == AF_UNIX)
saddr = NULL; /* no source information for UNIX addresses */
/* handle host options */