mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
reporting: validate time parsing with strtol
Check for out-of-range numbers being result of strtol parsing.
This commit is contained in:
parent
d79d919329
commit
26d97f179f
@ -898,7 +898,12 @@ static int _translate_time_items(struct dm_report *rh, struct time_info *info,
|
||||
id = ti->prop->id;
|
||||
|
||||
if (_is_time_num(id)) {
|
||||
errno = 0;
|
||||
num = strtol(ti->s, &end, 10);
|
||||
if (errno) {
|
||||
log_error("_translate_time_items: invalid time.");
|
||||
return 0;
|
||||
}
|
||||
switch (id) {
|
||||
case TIME_NUM_MULTIPLIER_NEGATIVE:
|
||||
multiplier = -num;
|
||||
|
Loading…
x
Reference in New Issue
Block a user