]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #170: Fix gcc undefined sanitizer signed integer overflow
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 27 Feb 2020 14:22:35 +0000 (15:22 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 27 Feb 2020 14:22:35 +0000 (15:22 +0100)
  warning in signature expiry RFC1982 serial number arithmetic.

doc/Changelog
validator/val_sigcrypt.c

index 7bb8e510414b35c34ff63496521d56595270582e..407c0d34df8c0ca4f0ae80d9ace6f2024449ab1f 100644 (file)
@@ -1,6 +1,8 @@
 27 February 2020: Wouter
        - Fix #169: Fix warning for daemon/remote.c output may be truncated
          from snprintf.
+       - Fix #170: Fix gcc undefined sanitizer signed integer overflow
+         warning in signature expiry RFC1982 serial number arithmetic.
 
 26 February 2020: Wouter
        - iana portlist updated.
index 33d206de8d7f2560c21282e386a993cae321bf6d..de730f681893b10d99c0e9c4b5a35ef57d9d9039 100644 (file)
@@ -1343,7 +1343,7 @@ adjust_ttl(struct val_env* ve, uint32_t unow,
        if(ve->date_override) {
                now = ve->date_override;
        } else  now = (int32_t)unow;
-       expittl = expi - now;
+       expittl = (int32_t)((uint32_t)expi - (uint32_t)now);
 
        /* so now:
         * d->ttl: rrset ttl read from message or cache. May be reduced