« Previous | Next » 

Revision b6db4aca

IDb6db4aca20e9af4f62c9c9e08b9b9672a6ed3390

Added by Paolo Bonzini over 11 years ago

rtc: fix overflow in mktimegm

When setting a date in 1980, Linux is actually disregarding the century
byte and setting the year to 2080. This causes a year-2038 overflow
in mktimegm. Fix this by doing the days-to-seconds computation in
64-bit math.

Reported-by: Lucas Meneghel Rodrigues <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences