mirror of
https://github.com/systemd/systemd.git
synced 2024-11-24 10:43:35 +08:00
calendarspec: fix possible integer overflow
Fixes oss-fuzz#14108. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14108
This commit is contained in:
parent
fb3ba5ec11
commit
daa4aca1cb
@ -579,6 +579,9 @@ static int calendarspec_from_time_t(CalendarSpec *c, time_t time) {
|
||||
if (!gmtime_r(&time, &tm))
|
||||
return -ERANGE;
|
||||
|
||||
if (tm.tm_year > INT_MAX - 1900)
|
||||
return -ERANGE;
|
||||
|
||||
r = const_chain(tm.tm_year + 1900, &year);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
1
test/fuzz/fuzz-calendarspec/oss-fuzz-14108
Normal file
1
test/fuzz/fuzz-calendarspec/oss-fuzz-14108
Normal file
@ -0,0 +1 @@
|
||||
@67767992554749550
|
Loading…
Reference in New Issue
Block a user