Do not send too big mesh-hello-messages
authorPhilipp Tölke <toelke@in.tum.de>
Wed, 15 Jun 2011 07:15:46 +0000 (07:15 +0000)
committerPhilipp Tölke <toelke@in.tum.de>
Wed, 15 Jun 2011 07:15:46 +0000 (07:15 +0000)
src/mesh/mesh_api.c

index 125ca05007e81f25bcae92a4dad7200e4c9cf45f..996c8303c4be13980ce0290aa2a7b869eda6df01 100644 (file)
@@ -188,6 +188,8 @@ send_hello_message (void *cls, size_t size, void *buf)
 
   size_t sent = sizeof(struct GNUNET_MessageHeader) + handle->hello_message_size;
 
+  if (sent > size) return 0;
+
   hdr->type = htons(GNUNET_MESSAGE_TYPE_MESH_HELLO);
   hdr->size = htons(size);