aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-20 12:50:34 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-20 12:50:34 +0000
commitb4a39ea2614e401d84807f0ebe51f94bbc8b77ff (patch)
treedde7e0f79b72aa1c03903c6520355ec73ac681a2 /src/gnsrecord
parent4576c5ef01c6ad841e00de0df3b9a418a3a75113 (diff)
downloadgnunet-b4a39ea2614e401d84807f0ebe51f94bbc8b77ff.tar.gz
gnunet-b4a39ea2614e401d84807f0ebe51f94bbc8b77ff.zip
-fix integer overflow on 'forever'
Diffstat (limited to 'src/gnsrecord')
-rw-r--r--src/gnsrecord/gnsrecord_crypto.c4
1 files changed, 3 insertions, 1 deletions
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,
108 { 108 {
109 /* encrypted blocks must never have relative expiration times, convert! */ 109 /* encrypted blocks must never have relative expiration times, convert! */
110 rdc[i].flags &= ~GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; 110 rdc[i].flags &= ~GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
111 rdc[i].expiration_time += now.abs_value_us; 111 rdc[i].expiration_time = GNUNET_TIME_absolute_add (now,
112 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,
113 rdc[i].expiration_time)).abs_value_us;
112 } 114 }
113 } 115 }
114 /* serialize */ 116 /* serialize */