If errno is zero, then buf is never filled and we're printing uninitialized data. Print the msg buffer instead to mitigate this.
Details
Details
- Reviewers
markj emaste - Commits
- rGcd90f3afb72a: syslogd: Do not print bad data
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Seems ok, but we might want to put a diagnostic in if the function is called with errno == 0, since that probably implies a bug in the caller. You could even just remove the errno != 0 check.