aboutsummaryrefslogtreecommitdiff
path: root/src/fs/meta_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/meta_data.c')
-rw-r--r--src/fs/meta_data.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/fs/meta_data.c b/src/fs/meta_data.c
index 3e2857101..7112a150a 100644
--- a/src/fs/meta_data.c
+++ b/src/fs/meta_data.c
@@ -1057,6 +1057,7 @@ GNUNET_FS_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
1057{ 1057{
1058 uint32_t size; 1058 uint32_t size;
1059 char *buf; 1059 char *buf;
1060 char *emsg;
1060 struct GNUNET_FS_MetaData *meta; 1061 struct GNUNET_FS_MetaData *meta;
1061 1062
1062 if (GNUNET_OK != GNUNET_BIO_read_int32 (h, 1063 if (GNUNET_OK != GNUNET_BIO_read_int32 (h,
@@ -1070,11 +1071,14 @@ GNUNET_FS_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
1070 } 1071 }
1071 if (MAX_META_DATA < size) 1072 if (MAX_META_DATA < size)
1072 { 1073 {
1073 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1074 GNUNET_asprintf (&emsg,
1074 _ ("Serialized metadata `%s' larger than allowed (%u > %u)"), 1075 _ (
1075 what, 1076 "Serialized metadata `%s' larger than allowed (%u > %u)\n"),
1076 size, 1077 what,
1077 MAX_META_DATA); 1078 size,
1079 MAX_META_DATA);
1080 GNUNET_BIO_read_set_error (h, emsg);
1081 GNUNET_free (emsg);
1078 return GNUNET_SYSERR; 1082 return GNUNET_SYSERR;
1079 } 1083 }
1080 buf = GNUNET_malloc (size); 1084 buf = GNUNET_malloc (size);
@@ -1119,6 +1123,10 @@ GNUNET_FS_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
1119 &buf, 1123 &buf,
1120 MAX_META_DATA, 1124 MAX_META_DATA,
1121 GNUNET_FS_META_DATA_SERIALIZE_PART); 1125 GNUNET_FS_META_DATA_SERIALIZE_PART);
1126 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1127 _ ("Serialized %ld bytes of metadata"),
1128 size);
1129
1122 if (-1 == size) 1130 if (-1 == size)
1123 { 1131 {
1124 GNUNET_free (buf); 1132 GNUNET_free (buf);