aboutsummaryrefslogtreecommitdiff
path: root/src/psyc
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-18 15:02:58 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-18 15:02:58 +0000
commit8e521a62065eaf390ca8f631bb7d1296f22b3075 (patch)
treee1f107d85d7c7b64580692c6fe167cb1eed5f472 /src/psyc
parentc654ca8072bc5768bd01c6b0d6db303b0d4e5025 (diff)
downloadgnunet-8e521a62065eaf390ca8f631bb7d1296f22b3075.tar.gz
gnunet-8e521a62065eaf390ca8f631bb7d1296f22b3075.zip
-fix bad allocation and message size calculation
Diffstat (limited to 'src/psyc')
-rw-r--r--src/psyc/psyc_api.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c
index 51902dd1a..18b5920b3 100644
--- a/src/psyc/psyc_api.c
+++ b/src/psyc/psyc_api.c
@@ -788,10 +788,9 @@ GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg,
788{ 788{
789 struct GNUNET_PSYC_Slave *slv = GNUNET_malloc (sizeof (*slv)); 789 struct GNUNET_PSYC_Slave *slv = GNUNET_malloc (sizeof (*slv));
790 struct GNUNET_PSYC_Channel *ch = &slv->ch; 790 struct GNUNET_PSYC_Channel *ch = &slv->ch;
791 struct SlaveJoinRequest *req = GNUNET_malloc (sizeof (*req)); 791 struct SlaveJoinRequest *req = GNUNET_malloc (sizeof (*req)
792 792 + relay_count * sizeof (*relays));
793 req->header.size = htons (sizeof (*req) 793 req->header.size = htons (sizeof (*req)
794 + sizeof (*channel_key) + sizeof (*slave_key)
795 + relay_count * sizeof (*relays)); 794 + relay_count * sizeof (*relays));
796 req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN); 795 req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN);
797 req->channel_key = *channel_key; 796 req->channel_key = *channel_key;