aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-02-02 17:25:55 +0000
committerLRN <lrn1986@gmail.com>2013-02-02 17:25:55 +0000
commit5a4e1ec9680f053ac7344d1baf686d867aa5ee8e (patch)
treeb9b9608df1c67aabcbbf6c1ea51a8f1d0c812776 /src/fs
parent3da727fad649c8c477fa6a2f02e6230780abe94f (diff)
downloadgnunet-5a4e1ec9680f053ac7344d1baf686d867aa5ee8e.tar.gz
gnunet-5a4e1ec9680f053ac7344d1baf686d867aa5ee8e.zip
Don't send more than 64k from fs helper
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/gnunet-helper-fs-publish.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c
index add45ede6..7ea94998d 100644
--- a/src/fs/gnunet-helper-fs-publish.c
+++ b/src/fs/gnunet-helper-fs-publish.c
@@ -377,6 +377,11 @@ extract_files (struct ScanTreeNode *item)
377 return GNUNET_SYSERR; 377 return GNUNET_SYSERR;
378 return GNUNET_OK; 378 return GNUNET_OK;
379 } 379 }
380 else if (size > (UINT16_MAX - sizeof (struct GNUNET_MessageHeader) - slen))
381 {
382 /* We can't transfer more than 64k bytes in one message. */
383 size = UINT16_MAX - sizeof (struct GNUNET_MessageHeader) - slen;
384 }
380 { 385 {
381 char buf[size + slen]; 386 char buf[size + slen];
382 char *dst = &buf[slen]; 387 char *dst = &buf[slen];