From b4a39ea2614e401d84807f0ebe51f94bbc8b77ff Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 20 Dec 2013 12:50:34 +0000 Subject: [PATCH] -fix integer overflow on 'forever' --- src/gnsrecord/gnsrecord_crypto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 */ -- 2.25.1