Page MenuHomeFreeBSD

tftpd: Satisfy clang-analyzer.
ClosedPublic

Authored by des on May 8 2024, 5:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 15, 2:14 AM
Unknown Object (File)
Sun, Nov 10, 9:03 PM
Unknown Object (File)
Thu, Nov 7, 6:22 PM
Unknown Object (File)
Wed, Nov 6, 5:39 PM
Unknown Object (File)
Wed, Nov 6, 12:49 AM
Unknown Object (File)
Tue, Nov 5, 10:44 AM
Unknown Object (File)
Mon, Oct 21, 7:40 PM
Unknown Object (File)
Oct 18 2024, 9:18 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 Not Applicable
Unit
Tests Not Applicable

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.