From: Christian Grothoff Date: Fri, 8 Jul 2016 17:38:59 +0000 (+0000) Subject: fix sanitization issues X-Git-Tag: initial-import-from-subversion-38251~569 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8a072a4db24fd858c1f0b4d2e07c3d2c877653f1;p=oweals%2Fgnunet.git fix sanitization issues --- diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c index 1c6b86e9e..21bbc538d 100644 --- a/src/fragmentation/fragmentation.c +++ b/src/fragmentation/fragmentation.c @@ -187,7 +187,7 @@ transmit_next (void *cls) return; /* all done */ /* calculate delay */ wrap = 0; - while (0 == (fc->acks & (1LL << fc->next_transmission))) + while (0 == (fc->acks & (1LLU << fc->next_transmission))) { fc->next_transmission = (fc->next_transmission + 1) % 64; wrap |= (0 == fc->next_transmission); @@ -218,7 +218,7 @@ transmit_next (void *cls) } fc->next_transmission = (fc->next_transmission + 1) % 64; wrap |= (0 == fc->next_transmission); - while (0 == (fc->acks & (1LL << fc->next_transmission))) + while (0 == (fc->acks & (1LLU << fc->next_transmission))) { fc->next_transmission = (fc->next_transmission + 1) % 64; wrap |= (0 == fc->next_transmission); @@ -348,7 +348,7 @@ GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, if (bits == 64) fc->acks_mask = UINT64_MAX; /* set all 64 bit */ else - fc->acks_mask = (1LL << bits) - 1; /* set lowest 'bits' bit */ + fc->acks_mask = (1LLU << bits) - 1; /* set lowest 'bits' bit */ fc->acks = fc->acks_mask; fc->task = GNUNET_SCHEDULER_add_now (&transmit_next, fc); return fc; diff --git a/src/fragmentation/fragmentation.h b/src/fragmentation/fragmentation.h index 5a75e988b..f585eb46b 100644 --- a/src/fragmentation/fragmentation.h +++ b/src/fragmentation/fragmentation.h @@ -44,18 +44,18 @@ struct FragmentHeader /** * Unique fragment ID. */ - uint32_t fragment_id; + uint32_t fragment_id GNUNET_PACKED; /** * Total message size of the original message. */ - uint16_t total_size; + uint16_t total_size GNUNET_PACKED; /** * Absolute offset (in bytes) of this fragment in the original * message. Will be a multiple of the MTU. */ - uint16_t offset; + uint16_t offset GNUNET_PACKED; }; @@ -74,14 +74,14 @@ struct FragmentAcknowledgement /** * Unique fragment ID. */ - uint32_t fragment_id; + uint32_t fragment_id GNUNET_PACKED; /** * Bits that are being acknowledged, in big-endian. * (bits that are set correspond to fragments that * have not yet been received). */ - uint64_t bits; + uint64_t bits GNUNET_PACKED; }; GNUNET_NETWORK_STRUCT_END