smartdevicelink / sdl_core

SmartDeviceLink In-Vehicle Software and Sample HMI
BSD 3-Clause "New" or "Revised" License
239 stars 245 forks source link

Resumption timestamps are limited to 32 bits #3948

Closed jacobkeeler closed 1 year ago

jacobkeeler commented 1 year ago

Bug Report

Detected by Coverity (CIDs 277332 and 277353).

The timestamp and last_ign_off_time parameters in the resumption data storage are currently written to and read as uint32_t, which could be shorter than time_t. These parameters should be stored as int64_t to prevent narrowing conversions. See here

Reproduction Steps
  1. Set clock so that the timestamp goes past the unsigned 32 bit limit (year=2200 should work)
  2. Start Core
  3. Connect app
  4. Stop Core and check app_info.dat
Expected Behavior

timestamp should match up with system clock

Observed Behavior

timestamp does not match up with system clock due to narrowing conversion

OS & Version Information
ShobhitAd commented 1 year ago

Closed via https://github.com/smartdevicelink/sdl_core/pull/3946