aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/plugin_namestore_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/plugin_namestore_postgres.c')
-rw-r--r--src/namestore/plugin_namestore_postgres.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c
index d7907b1a6..09fdd760f 100644
--- a/src/namestore/plugin_namestore_postgres.c
+++ b/src/namestore/plugin_namestore_postgres.c
@@ -220,7 +220,7 @@ namestore_postgres_store_records (void *cls,
220 struct GNUNET_CRYPTO_EcdsaPublicKey pkey; 220 struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
221 uint64_t rvalue; 221 uint64_t rvalue;
222 uint32_t rd_count32 = (uint32_t) rd_count; 222 uint32_t rd_count32 = (uint32_t) rd_count;
223 size_t data_size; 223 ssize_t data_size;
224 224
225 memset (&pkey, 225 memset (&pkey,
226 0, 226 0,
@@ -238,7 +238,12 @@ namestore_postgres_store_records (void *cls,
238 UINT64_MAX); 238 UINT64_MAX);
239 data_size = GNUNET_GNSRECORD_records_get_size (rd_count, 239 data_size = GNUNET_GNSRECORD_records_get_size (rd_count,
240 rd); 240 rd);
241 if (data_size > 64 * 65536) 241 if (data_size < 0)
242 {
243 GNUNET_break (0);
244 return GNUNET_SYSERR;
245 }
246 if (data_size >= UINT16_MAX)
242 { 247 {
243 GNUNET_break (0); 248 GNUNET_break (0);
244 return GNUNET_SYSERR; 249 return GNUNET_SYSERR;
@@ -287,7 +292,7 @@ namestore_postgres_store_records (void *cls,
287 data_size, 292 data_size,
288 data); 293 data);
289 if ( (ret < 0) || 294 if ( (ret < 0) ||
290 (data_size != (size_t) ret) ) 295 (data_size != ret) )
291 { 296 {
292 GNUNET_break (0); 297 GNUNET_break (0);
293 return GNUNET_SYSERR; 298 return GNUNET_SYSERR;