Submit #2717
openOut of range numeric handling
Description
In a similar way than OpenBSD, the numeric values overflows are checked.
Files
Updated by dclink over 10 years ago
- Subject changed from Sysctl out of range numeric handling handling to Sysctl out of range numeric handling
- Status changed from New to Resolved
Updated by dclink over 10 years ago
- File patch-atoi.txt patch-atoi.txt added
- Subject changed from Sysctl out of range numeric handling to Out of range numeric handling
- Category changed from Kernel to Userland
Finally made more out of range handling in some base utilities. For example vi with a wrong COLUMNS env var led to segmentation fault. Ported small fixes in ifconfig 80211 part from FreeBSD (use of d value instead of atoi(val) when it was necessary) and so on.
Updated by tuxillo almost 10 years ago
- Assignee set to tuxillo
- % Done changed from 100 to 0
Hi,
The patch looks okay besides a few wrong tabs which is really minor.
But I'd like to understand why you don't use strtonum() more consistently, for example you use strtol() and an ERANGE check in some other places:
- dtrwait = atoi(argv3);
+ dtrwait = strtol(argv3, NULL, 10);
+ if (errno == ERANGE)
+ usage();
Cheers,
Antonio Huete