Actions
Submit #2717
openOut of range numeric handling
Description
In a similar way than OpenBSD, the numeric values overflows are checked.
Files
Actions
Added by dclink over 10 years ago. Updated over 3 years ago.
Description
In a similar way than OpenBSD, the numeric values overflows are checked.
Files
patch-atoi.txt (16.4 KB) patch-atoi.txt | dclink, 08/24/2014 12:27 AM |
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.
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