Fix potential signed integer overflow in ODK
PiperOrigin-RevId: 573265338 Change-Id: I33dbced572941c9646f7496e20b8d9a49bca5811
This commit is contained in:
@@ -19,7 +19,7 @@ extern "C" {
|
||||
#define ODK_MINOR_VERSION 0
|
||||
|
||||
/* ODK Version string. Date changed automatically on each release. */
|
||||
#define ODK_RELEASE_DATE "ODK v19.0 2023-10-11"
|
||||
#define ODK_RELEASE_DATE "ODK v19.0 2023-10-13"
|
||||
|
||||
/* The lowest version number for an ODK message. */
|
||||
#define ODK_FIRST_VERSION 16
|
||||
|
||||
@@ -167,9 +167,14 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features,
|
||||
timer_limits.rental_duration_seconds = policy.rental_duration_seconds();
|
||||
timer_limits.total_playback_duration_seconds =
|
||||
policy.playback_duration_seconds();
|
||||
// On devices these seconds are tracking time so should not be negative.
|
||||
if (policy.renewal_delay_seconds() < 0 ||
|
||||
policy.renewal_recovery_duration_seconds() < 0) {
|
||||
return false;
|
||||
}
|
||||
timer_limits.initial_renewal_duration_seconds =
|
||||
policy.renewal_delay_seconds() +
|
||||
policy.renewal_recovery_duration_seconds();
|
||||
static_cast<uint64_t>(policy.renewal_delay_seconds()) +
|
||||
static_cast<uint64_t>(policy.renewal_recovery_duration_seconds());
|
||||
|
||||
parsed_lic.key_array = key_array.data();
|
||||
parsed_lic.key_array_length = static_cast<uint32_t>(key_array.size());
|
||||
|
||||
Reference in New Issue
Block a user