From: Christian Grothoff Date: Sat, 24 Mar 2012 19:30:46 +0000 (+0000) Subject: -fix #2232 X-Git-Tag: initial-import-from-subversion-38251~14097 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9ac0acb2484d3b73542315f2164e1a08f80d989c;p=oweals%2Fgnunet.git -fix #2232 --- diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c index 4bb77fa22..b96559cd1 100644 --- a/src/fs/gnunet-helper-fs-publish.c +++ b/src/fs/gnunet-helper-fs-publish.c @@ -373,8 +373,13 @@ extract_files (struct ScanTreeNode *item) memcpy (buf, item->filename, slen); size = GNUNET_CONTAINER_meta_data_serialize (meta, - &dst, size - slen, + &dst, size, GNUNET_CONTAINER_META_DATA_SERIALIZE_PART); + if (size < 0) + { + GNUNET_break (0); + size = 0; + } GNUNET_CONTAINER_meta_data_destroy (meta); if (GNUNET_OK != write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA,