Page MenuHomeFreeBSD

tftpd: Satisfy clang-analyzer.
ClosedPublic

Authored by des on May 8 2024, 5:57 PM.
Tags
None
Referenced Files
F100679906: D45132.diff
Fri, Oct 18, 7:17 AM
F100614027: D45132.id138283.diff
Thu, Oct 17, 10:21 AM
F100605186: D45132.diff
Thu, Oct 17, 7:55 AM
Unknown Object (File)
Wed, Oct 16, 1:43 PM
Unknown Object (File)
Wed, Oct 16, 7:31 AM
Unknown Object (File)
Tue, Oct 15, 7:55 PM
Unknown Object (File)
Tue, Oct 15, 7:53 AM
Unknown Object (File)
Mon, Oct 14, 7:26 PM
Subscribers

Details

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

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57634
Build 54522: 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.
libexec/tftpd/tftp-io.c
80

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
libexec/tftpd/tftp-io.c
80

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.