Page MenuHomeFreeBSD

syslogd: Do not print bad data
ClosedPublic

Authored by jfree on Aug 8 2023, 3:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 23, 2:53 AM
Unknown Object (File)
Sat, Apr 20, 1:58 PM
Unknown Object (File)
Apr 10 2024, 11:25 PM
Unknown Object (File)
Apr 6 2024, 12:18 PM
Unknown Object (File)
Apr 6 2024, 10:28 AM
Unknown Object (File)
Mar 13 2024, 1:07 AM
Unknown Object (File)
Mar 13 2024, 1:02 AM
Unknown Object (File)
Jan 9 2024, 12:40 PM
Subscribers

Details

Summary
If errno is zero, then buf is never filled and we're printing
uninitialized data. Print the msg buffer instead to mitigate this.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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.

This revision is now accepted and ready to land.Aug 9 2023, 7:39 PM
This revision now requires review to proceed.Aug 10 2023, 11:12 PM
This revision is now accepted and ready to land.Aug 11 2023, 2:56 PM
This revision was automatically updated to reflect the committed changes.