Page MenuHomeFreeBSD

lpd: Fix issues reported by clang-analyzer
ClosedPublic

Authored by des on May 22 2026, 8:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 16, 10:17 AM
Unknown Object (File)
Tue, Jun 16, 2:27 AM
Unknown Object (File)
Tue, Jun 9, 9:20 AM
Unknown Object (File)
Tue, Jun 9, 9:17 AM
Unknown Object (File)
Tue, Jun 9, 4:09 AM
Unknown Object (File)
Tue, Jun 9, 4:06 AM
Unknown Object (File)
Tue, Jun 9, 1:21 AM
Unknown Object (File)
Tue, Jun 9, 1:19 AM
Subscribers

Diff Detail

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

Event Timeline

des requested review of this revision.May 22 2026, 8:28 PM
markj added inline comments.
usr.sbin/lpr/lpd/printjob.c
202–203

The first sentence isn't necessarily true. I don't think it matters much though.

This revision is now accepted and ready to land.Mon, May 25, 12:58 PM
usr.sbin/lpr/lpd/printjob.c
202–203

Barring a race condition, I think it's pretty much the only way we can get to this point with a non-zero statok, isn't it? Although perhaps we should make the fstat() unconditional and error out if it fails; just moving it into the condition for the if above should do the trick.

usr.sbin/lpr/lpd/printjob.c
202–203

Yes, I was thinking of a race condition. I think checking after open() would be simpler.

This revision now requires review to proceed.Mon, May 25, 2:35 PM
This revision is now accepted and ready to land.Mon, May 25, 2:41 PM
des marked 2 inline comments as done.Mon, May 25, 5:02 PM
This revision was automatically updated to reflect the committed changes.