From: Christian Grothoff Date: Fri, 20 Dec 2013 12:50:34 +0000 (+0000) Subject: -fix integer overflow on 'forever' X-Git-Tag: initial-import-from-subversion-38251~5265 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b4a39ea2614e401d84807f0ebe51f94bbc8b77ff;p=oweals%2Fgnunet.git -fix integer overflow on 'forever' --- diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c index a9c35a6d8..a17a64480 100644 --- a/src/gnsrecord/gnsrecord_crypto.c +++ b/src/gnsrecord/gnsrecord_crypto.c @@ -108,7 +108,9 @@ GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, { /* encrypted blocks must never have relative expiration times, convert! */ rdc[i].flags &= ~GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; - rdc[i].expiration_time += now.abs_value_us; + rdc[i].expiration_time = GNUNET_TIME_absolute_add (now, + GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS, + rdc[i].expiration_time)).abs_value_us; } } /* serialize */