LLCache: validate max-age before use

This commit is contained in:
John-Mark Bell 2019-06-10 21:36:52 +00:00
parent 23698aecf8
commit c1dc4e61bd

View File

@ -602,7 +602,9 @@ llcache_fetch_parse_cache_control(llcache_object *object, char *value)
object->cache.no_cache = LLCACHE_VALIDATE_ALWAYS; object->cache.no_cache = LLCACHE_VALIDATE_ALWAYS;
} }
object->cache.max_age = http_cache_control_max_age(cc); if (http_cache_control_has_max_age(cc)) {
object->cache.max_age = http_cache_control_max_age(cc);
}
http_cache_control_destroy(cc); http_cache_control_destroy(cc);