commit b4a39ea2614e401d84807f0ebe51f94bbc8b77ff parent 4576c5ef01c6ad841e00de0df3b9a418a3a75113 Author: Christian Grothoff <christian@grothoff.org> Date: Fri, 20 Dec 2013 12:50:34 +0000 -fix integer overflow on 'forever' Diffstat:
| M | 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 @@ -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 */