Merge pull request #8487 from keszybz/oss-fuzz-fixes

Oss fuzz fixes, another batch
This commit is contained in:
Lennart Poettering
2018-03-21 11:50:57 +01:00
committed by GitHub
6 changed files with 28 additions and 6 deletions
+6
View File
@@ -187,6 +187,8 @@ int calendar_spec_normalize(CalendarSpec *c) {
}
_pure_ static bool chain_valid(CalendarComponent *c, int from, int to, bool end_of_month) {
assert(to >= from);
if (!c)
return true;
@@ -197,6 +199,10 @@ _pure_ static bool chain_valid(CalendarComponent *c, int from, int to, bool end_
if (c->start < from || c->start > to)
return false;
/* Avoid overly large values that could cause overflow */
if (c->repeat > to - from)
return false;
/*
* c->repeat must be short enough so at least one repetition may
* occur before the end of the interval. For dates scheduled
+2 -2
View File
@@ -13,10 +13,10 @@
#define IOPRIO_BITS 16
#define IOPRIO_N_CLASSES 8
#define IOPRIO_CLASS_SHIFT 13
#define IOPRIO_PRIO_DATA_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
#define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_DATA_MASK)
#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
#define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
#define ioprio_valid(mask) (IOPRIO_PRIO_CLASS((mask)) != IOPRIO_CLASS_NONE)