GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
pos++;
slen++;
}
- if ('\0' != *pos)
+ if (left == 0)
{
/* 0-termination not found */
GNUNET_break_op (0);
GNUNET_HELLO_GenerateAddressListCallback addrgen,
void *addrgen_cls)
{
- char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 256 -
+ char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1 - 256 -
sizeof (struct GNUNET_HELLO_Message)];
size_t max;
size_t used;
addrlen)) )
{
ec->found = GNUNET_YES;
- if (expiration.value < ec->expiration.value)
- {
- ec->result = GNUNET_TIME_absolute_min (expiration,
- ec->result);
- }
+ if (expiration.value < ec->expiration.value)
+ ec->result = GNUNET_TIME_absolute_min (expiration,
+ ec->result);
return GNUNET_SYSERR;
}
return GNUNET_YES;
* @param h2 the second HELLO message
* @param now time to use for deciding which addresses have
* expired and should not be considered at all
- * @return absolute time zero if the two HELLOs are
+ * @return absolute time forever if the two HELLOs are
* totally identical; smallest timestamp >= now if
* they only differ in timestamps;
- * forever if the some addresses with expirations >= now
+ * zero if the some addresses with expirations >= now
* do not match at all
*/
struct GNUNET_TIME_Absolute
{
struct EqualsContext ec;
+ if (0 != memcmp (&h1->publicKey,
+ &h2->publicKey,
+ sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
+ return GNUNET_TIME_UNIT_ZERO_ABS;
ec.expiration_limit = now;
ec.result = GNUNET_TIME_UNIT_FOREVER_ABS;
ec.h2 = h2;