diff options
Diffstat (limited to 'src/ats/ats_api_scheduling.c')
-rw-r--r-- | src/ats/ats_api_scheduling.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index 8b3e849b2..93cd7eab4 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c | |||
@@ -281,6 +281,7 @@ process_ats_message (void *cls, | |||
281 | const char *address; | 281 | const char *address; |
282 | const char *plugin_name; | 282 | const char *plugin_name; |
283 | uint16_t address_length; | 283 | uint16_t address_length; |
284 | uint16_t plugin_name_length; | ||
284 | uint32_t ats_count; | 285 | uint32_t ats_count; |
285 | 286 | ||
286 | if (NULL == msg) | 287 | if (NULL == msg) |
@@ -305,12 +306,13 @@ process_ats_message (void *cls, | |||
305 | atsi = (const struct GNUNET_TRANSPORT_ATS_Information*) &m[1]; | 306 | atsi = (const struct GNUNET_TRANSPORT_ATS_Information*) &m[1]; |
306 | address = (const char*) &atsi[ats_count]; | 307 | address = (const char*) &atsi[ats_count]; |
307 | plugin_name = &address[address_length]; | 308 | plugin_name = &address[address_length]; |
308 | if ( (ntohs (m->address_length) + | 309 | plugin_name_length = ntohs (m->plugin_name_length); |
309 | ntohs (m->plugin_name_length) + | 310 | if ( (address_length + |
311 | plugin_name_length + | ||
310 | ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information) + | 312 | ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information) + |
311 | sizeof (struct AddressSuggestionMessage) != ntohs (msg->size)) || | 313 | sizeof (struct AddressSuggestionMessage) != ntohs (msg->size)) || |
312 | (ats_count > GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_TRANSPORT_ATS_Information)) || | 314 | (ats_count > GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_TRANSPORT_ATS_Information)) || |
313 | (plugin_name[ntohs (m->plugin_name_length) - 1] != '\0') ) | 315 | (plugin_name[plugin_name_length - 1] != '\0') ) |
314 | { | 316 | { |
315 | GNUNET_break (0); | 317 | GNUNET_break (0); |
316 | GNUNET_CLIENT_disconnect (sh->client, GNUNET_NO); | 318 | GNUNET_CLIENT_disconnect (sh->client, GNUNET_NO); |