Page MenuHomeFreeBSD

cpucontrol: Be more strict with input validation
ClosedPublic

Authored by markj on Tue, Jan 27, 9:23 PM.
Tags
None
Referenced Files
F143321929: D54919.id170649.diff
Wed, Jan 28, 9:18 PM
F143277177: D54919.id170618.diff
Wed, Jan 28, 9:09 AM
F143271308: D54919.diff
Wed, Jan 28, 8:13 AM
F143268609: D54919.id.diff
Wed, Jan 28, 7:30 AM
F143268236: D54919.id170614.diff
Wed, Jan 28, 7:25 AM
F143260895: D54919.id170614.diff
Wed, Jan 28, 5:35 AM
F143259485: D54919.id.diff
Wed, Jan 28, 5:14 AM
F143256776: D54919.id170618.diff
Wed, Jan 28, 4:31 AM
Subscribers

Details

Summary

Avoid truncating 32-bit values. This would have saved me a bit of time
when I was looking at a cpuid leaf on my system and typed 0x80000001f
instead of 0x8000001f.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Tue, Jan 27, 9:23 PM
usr.sbin/cpucontrol/cpucontrol.c
123

Why not strtoumax() then?

126

I do not think that usage() is required there, user does know what she did, but mis-typed the input.

markj marked 2 inline comments as done.

Handle kib's comments.

usr.sbin/cpucontrol/cpucontrol.c
126

Ok, I just copied the prevailing pattern.

This revision is now accepted and ready to land.Tue, Jan 27, 11:22 PM