Page MenuHomeFreeBSD

syslogd: Do not print bad data
ClosedPublic

Authored by jfree on Aug 8 2023, 3:35 PM.
Tags
None
Referenced Files
F106201102: D41371.diff
Fri, Dec 27, 1:49 AM
Unknown Object (File)
Tue, Dec 10, 2:20 PM
Unknown Object (File)
Mon, Dec 9, 2:16 PM
Unknown Object (File)
Thu, Dec 5, 7:14 PM
Unknown Object (File)
Tue, Dec 3, 10:23 AM
Unknown Object (File)
Thu, Nov 28, 2:11 AM
Unknown Object (File)
Nov 20 2024, 1:25 PM
Unknown Object (File)
Nov 7 2024, 4:30 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 Skipped
Unit
Tests Skipped

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.