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)
Mon, Oct 21, 5:25 AM
Unknown Object (File)
Mon, Oct 21, 5:25 AM
Unknown Object (File)
Mon, Oct 21, 5:25 AM
Unknown Object (File)
Mon, Oct 21, 3:40 AM
Unknown Object (File)
Mon, Oct 21, 3:34 AM
Unknown Object (File)
Fri, Oct 18, 11:00 PM
Unknown Object (File)
Sep 27 2024, 5:12 AM
Unknown Object (File)
Sep 24 2024, 6:08 AM
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.