Page MenuHomeFreeBSD

tftpd: Satisfy clang-analyzer.
ClosedPublic

Authored by des on May 8 2024, 5:57 PM.
Tags
None
Referenced Files
F99355356: D45132.diff
Tue, Oct 8, 6:38 PM
F99337360: D45132.diff
Tue, Oct 8, 1:32 PM
F99296934: D45132.id138283.diff
Tue, Oct 8, 3:47 AM
Unknown Object (File)
Mon, Oct 7, 3:56 PM
Unknown Object (File)
Mon, Oct 7, 12:32 PM
Unknown Object (File)
Mon, Oct 7, 12:32 PM
Unknown Object (File)
Sun, Oct 6, 11:16 PM
Unknown Object (File)
Sun, Oct 6, 10:09 AM
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 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.
libexec/tftpd/tftp-io.c
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
libexec/tftpd/tftp-io.c
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.