Page MenuHomeFreeBSD

tftpd: Satisfy clang-analyzer.

Authored by des on May 8 2024, 5:57 PM.
Referenced Files
F89169651: D45132.diff
Wed, Jul 24, 8:13 AM
F89149815: D45132.diff
Wed, Jul 24, 2:23 AM
Unknown Object (File)
Mon, Jul 1, 3:22 AM
Unknown Object (File)
Fri, Jun 28, 9:55 AM
Unknown Object (File)
May 19 2024, 5:19 PM
Unknown Object (File)
May 11 2024, 6:39 PM
Unknown Object (File)
May 10 2024, 7:20 PM
Unknown Object (File)
May 10 2024, 7:19 PM


  • Replace random() with arc4random().
  • Change some variable types.
  • Drop some unused assignments.

MFC after: 3 days
Sponsored by: Klara, Inc.

Diff Detail

rG FreeBSD src repository
Lint Skipped
Tests Skipped
Build Status
Buildable 57625
Build 54513: arc lint + arc unit

Event Timeline

des requested review of this revision.May 8 2024, 5:57 PM
This revision is now accepted and ready to land.May 8 2024, 9:31 PM
des retitled this revision from tftpd: Type nit. to tftpd: Satisfy clang-analyzer..May 9 2024, 10:52 AM
This revision now requires review to proceed.May 9 2024, 10:53 AM
markj added a subscriber: markj.
markj added inline comments.
80 ↗(On Diff #138283)

What's wrong with random() here? arc4random() is overkill for what this is doing.

This revision is now accepted and ready to land.May 9 2024, 3:37 PM
80 ↗(On Diff #138283)

Agreed, this is solely to silence make analyze. I doubt this code ever gets used anyway, the option that enables it is undocumented and the test suite doesn't even glance in its direction.

This revision was automatically updated to reflect the committed changes.