diff options
| author | Brian Wellington <bwelling@xbill.org> | 2020-06-24 17:04:59 -0700 |
|---|---|---|
| committer | Brian Wellington <bwelling@xbill.org> | 2020-06-24 17:07:46 -0700 |
| commit | 903b4f7298c06264c3eb9c57e50e15c733a58ffb (patch) | |
| tree | b07ae38a27b42e739719ad96170d0f9d98fb2892 /dns/message.py | |
| parent | a02c330e4f394f4e5200266ce1b145b9a1731262 (diff) | |
| download | dnspython-903b4f7298c06264c3eb9c57e50e15c733a58ffb.tar.gz | |
Fix TTL limiting.
The message code would convert negative TTL into 0, but the TTL could
never be negative, as it was read with the '!I' format, which reads
unsigned 32 bit integers. We don't want to change that, since OPT flags
(which are encoded in the TTL) should be treated as unsigned. Instead,
treat all TTLs > (2^31 - 1) as 0.
Diffstat (limited to 'dns/message.py')
| -rw-r--r-- | dns/message.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dns/message.py b/dns/message.py index 63a55db..132149d 100644 --- a/dns/message.py +++ b/dns/message.py @@ -732,7 +732,7 @@ class _WireReader: self.message.first) self.message.had_tsig = True else: - if ttl < 0: + if ttl > 0x7fffffff: ttl = 0 if self.updating and \ rdclass in (dns.rdataclass.ANY, dns.rdataclass.NONE): |
