From 9ac0acb2484d3b73542315f2164e1a08f80d989c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 24 Mar 2012 19:30:46 +0000 Subject: [PATCH] -fix #2232 --- src/fs/gnunet-helper-fs-publish.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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, -- 2.25.1