Out of range numeric handling
In a similar way than OpenBSD, the numeric values overflows are checked.
Updated by dclink over 5 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 about 5 years ago
- Assignee set to tuxillo
- % Done changed from 100 to 0
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(argv);
+ dtrwait = strtol(argv, NULL, 10);
+ if (errno == ERANGE)