aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ats/gnunet-service-ats_scheduling.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c
index 2d5a354e8..72b72cd3e 100644
--- a/src/ats/gnunet-service-ats_scheduling.c
+++ b/src/ats/gnunet-service-ats_scheduling.c
@@ -240,12 +240,13 @@ GAS_handle_address_update (void *cls, struct GNUNET_SERVER_Client *client,
240 plugin_name = &address[address_length]; 240 plugin_name = &address[address_length];
241 else 241 else
242 plugin_name = ""; 242 plugin_name = "";
243
243 if ((address_length + plugin_name_length + 244 if ((address_length + plugin_name_length +
244 ats_count * sizeof (struct GNUNET_ATS_Information) + 245 ats_count * sizeof (struct GNUNET_ATS_Information) +
245 sizeof (struct AddressUpdateMessage) != ntohs (message->size)) || 246 sizeof (struct AddressUpdateMessage) != ntohs (message->size)) ||
246 (ats_count > 247 (ats_count >
247 GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information)) 248 GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information)) ||
248 || (plugin_name[plugin_name_length - 1] != '\0')) 249 ((plugin_name_length > 0) && (plugin_name[plugin_name_length - 1] != '\0')))
249 { 250 {
250 GNUNET_break (0); 251 GNUNET_break (0);
251 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 252 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);