Project

General

Profile

Actions

Submit #2717

open

Out of range numeric handling

Added by dclink over 10 years ago. Updated over 3 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
Category:
Userland
Target version:
Start date:
08/22/2014
Due date:
% Done:

0%

Estimated time:

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
Actions #1

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
Actions #2

Updated by dclink over 10 years ago

  • Target version set to 3.9.x
Actions #3

Updated by dclink over 10 years ago

  • Status changed from Resolved to Feedback
Actions #4

Updated by dclink over 10 years ago

  • File deleted (diff-sysctl.c)
Actions #5

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.

Actions #6

Updated by tuxillo almost 10 years ago

  • Target version changed from 3.9.x to 4.2

Grab

Actions #7

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

Actions #8

Updated by tuxillo over 3 years ago

  • Target version changed from 4.2 to 6.0
Actions

Also available in: Atom PDF