aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesh/mesh_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index 7564a7ec58..cdc551f3dd 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -1843,7 +1843,7 @@ GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h,
offset = 0;
do
{
- msgsize = (len > offset + payload) ? payload : len;
+ msgsize = (len - offset > payload) ? payload : len - offset;
memcpy (&msg[1], &regex[offset], msgsize);
offset += msgsize;
msgsize += sizeof(struct GNUNET_MESH_RegexAnnounce);