diff -ur unbound-1.8.1.org/util/data/msgreply.c unbound-1.8.1.cmt/util/data/msgreply.c
--- unbound-1.8.1.org/util/data/msgreply.c	2018-09-13 21:30:44.000000000 +0900
+++ unbound-1.8.1.cmt/util/data/msgreply.c	2018-12-02 01:03:22.000000000 +0900
@@ -197,6 +197,10 @@
 		*rr_ttl = MIN_TTL;
 	if(*rr_ttl < data->ttl)
 		data->ttl = *rr_ttl;
+	if(*rr_ttl > MAX_TTL)
+		*rr_ttl = MAX_TTL;
+	if(*rr_ttl > data->ttl)
+		data->ttl = *rr_ttl;
 
 	if(rr->outside_packet) {
 		/* uncompressed already, only needs copy */
