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
received_msg = (struct GNUNET_DV_MessageReceived *)msg;
packed_msg_len = ntohl(received_msg->msg_len);
- sender_address_len = ntohl(received_msg->sender_address_len);
-
- GNUNET_assert(ntohs(msg->size) == (sizeof(struct GNUNET_DV_MessageReceived) + packed_msg_len + sender_address_len));
+ sender_address_len = ntohs(msg->size) - packed_msg_len - sizeof(struct GNUNET_DV_MessageReceived);
+ GNUNET_assert(sender_address_len > 0);
sender_address = GNUNET_malloc(sender_address_len);
memcpy(sender_address, &received_msg[1], sender_address_len);
packed_msg_start = (char *)&received_msg[1];