Page MenuHomeFreeBSD

cpucontrol: Be more strict with input validation
ClosedPublic

Authored by markj on Tue, Jan 27, 9:23 PM.
Tags
None
Referenced Files
F145674058: D54919.id170618.diff
Sun, Feb 22, 11:32 PM
Unknown Object (File)
Mon, Feb 16, 7:01 PM
Unknown Object (File)
Mon, Feb 16, 7:01 PM
Unknown Object (File)
Sun, Feb 15, 12:45 PM
Unknown Object (File)
Thu, Feb 12, 5:14 PM
Unknown Object (File)
Wed, Feb 11, 10:36 PM
Unknown Object (File)
Wed, Feb 11, 4:43 AM
Unknown Object (File)
Tue, Feb 10, 10:35 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 70174
Build 67057: arc lint + arc unit

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