diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-11-09 17:32:43 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-11-09 17:32:43 +0100 |
commit | b230fdfa9da2f31e6cc90f90579c6d020c770f86 (patch) | |
tree | 33614c264bc528461c429f36980a8bca626107e6 | |
parent | a82fb1b9d8a046e01dbad33bb57d064815d60e5c (diff) | |
download | busybox-w32-b230fdfa9da2f31e6cc90f90579c6d020c770f86.tar.gz busybox-w32-b230fdfa9da2f31e6cc90f90579c6d020c770f86.tar.bz2 busybox-w32-b230fdfa9da2f31e6cc90f90579c6d020c770f86.zip |
taskset: tighten the check for stride values
function old new delta
taskset_main 986 987 +1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | util-linux/taskset.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util-linux/taskset.c b/util-linux/taskset.c index df1bc0a4f..b542f8c83 100644 --- a/util-linux/taskset.c +++ b/util-linux/taskset.c | |||
@@ -149,8 +149,8 @@ static void parse_cpulist(ul *mask, unsigned max, char *s) | |||
149 | if ((*s != ',' && *s != '\0') | 149 | if ((*s != ',' && *s != '\0') |
150 | || bit > end | 150 | || bit > end |
151 | || end == UINT_MAX /* bb_strtou returns this on malformed / ERANGE numbers */ | 151 | || end == UINT_MAX /* bb_strtou returns this on malformed / ERANGE numbers */ |
152 | || stride == 0 | 152 | || (stride - 1) > (UINT_MAX / 4) |
153 | || stride == UINT_MAX | 153 | /* disallow 0, malformed input, and too large stride prone to overflows */ |
154 | ) { | 154 | ) { |
155 | bb_error_msg_and_die("bad affinity '%s'", aff); | 155 | bb_error_msg_and_die("bad affinity '%s'", aff); |
156 | } | 156 | } |