Page MenuHomeFreeBSD

tftpd: Satisfy clang-analyzer.
ClosedPublic

Authored by des on Wed, May 8, 5:57 PM.
Tags
None
Referenced Files
F84122565: D45132.id138384.diff
Sun, May 19, 5:19 PM
Unknown Object (File)
Sat, May 11, 6:39 PM
Unknown Object (File)
Fri, May 10, 7:20 PM
Unknown Object (File)
Fri, May 10, 7:19 PM
Unknown Object (File)
Fri, May 10, 5:21 PM
Unknown Object (File)
Fri, May 10, 4:27 PM
Unknown Object (File)
Fri, May 10, 4:27 PM
Unknown Object (File)
Fri, May 10, 4:03 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Wed, May 8, 5:57 PM
This revision is now accepted and ready to land.Wed, May 8, 9:31 PM
des retitled this revision from tftpd: Type nit. to tftpd: Satisfy clang-analyzer..Thu, May 9, 10:52 AM
This revision now requires review to proceed.Thu, May 9, 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.Thu, May 9, 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.