diff options
Diffstat (limited to '')
-rw-r--r--source/cache.c4
1 file changed, 3 insertions, 1 deletion
diff --git a/source/cache.c b/source/cache.c
index af391db..a076823 100644
--- a/source/cache.c
+++ b/source/cache.c
@@ -189,7 +189,9 @@ static int is_expired(struct cache_slot *slot)
{
if (slot->ttl < 0)
return 0;
- return slot->st.st_mtime + slot->ttl * SECONDS_PER_MINUTE < time(NULL);
+ // Widened before the multiply, since a ttl in the tens of millions of
+ // minutes overflows an int.
+ return slot->st.st_mtime + (time_t)slot->ttl * SECONDS_PER_MINUTE < time(NULL);
}
/*