There are several problems with data types, casts, and checks in
getlocalbase(). This attempts to fix them
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 34811 Build 31852: arc lint + arc unit
Event Timeline
lib/libutil/getlocalbase.c | ||
---|---|---|
77 | strlcpy doesn't include the NUL so this to stay >=. |
lib/libutil/getlocalbase.c | ||
---|---|---|
53–54 | This should probably be EINVAL (and could then be folded into the previous if). |
Comment Actions
Fix items suggested by Jessica, move to sysctlnametomib() to account for
inconsistencies in the user/kernel interface
lib/libutil/getlocalbase.c | ||
---|---|---|
60 | miblen is currently uninitialised before the call; presumably it works because it's reading random garbage on the stack that's most likely >= 2. You should probably also be checking the return value here. |