diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datastore/gnunet-service-datastore.c | 5 | ||||
-rw-r--r-- | src/util/common_allocation.c | 1 | ||||
-rw-r--r-- | src/util/container_bloomfilter.c | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index be88d288e..327244ffd 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c | |||
@@ -1492,7 +1492,10 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
1492 | cache_size = quota / 8; /* Or should we make this an option? */ | 1492 | cache_size = quota / 8; /* Or should we make this an option? */ |
1493 | GNUNET_STATISTICS_set (stats, gettext_noop ("# cache size"), cache_size, | 1493 | GNUNET_STATISTICS_set (stats, gettext_noop ("# cache size"), cache_size, |
1494 | GNUNET_NO); | 1494 | GNUNET_NO); |
1495 | bf_size = quota / 32; /* 8 bit per entry, 1 bit per 32 kb in DB */ | 1495 | if (quota / 32LL > (1 << 31)) |
1496 | bf_size = (1 << 31); /* absolute limit: ~2 GB, beyond that BF just won't help anyway */ | ||
1497 | else | ||
1498 | bf_size = quota / 32; /* 8 bit per entry, 1 bit per 32 kb in DB */ | ||
1496 | fn = NULL; | 1499 | fn = NULL; |
1497 | if ((GNUNET_OK != | 1500 | if ((GNUNET_OK != |
1498 | GNUNET_CONFIGURATION_get_value_filename (cfg, "DATASTORE", "BLOOMFILTER", | 1501 | GNUNET_CONFIGURATION_get_value_filename (cfg, "DATASTORE", "BLOOMFILTER", |
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index fd5e993e2..5e1f75eb7 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c | |||
@@ -136,7 +136,6 @@ GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber) | |||
136 | return NULL; | 136 | return NULL; |
137 | #endif | 137 | #endif |
138 | 138 | ||
139 | GNUNET_assert_at (size < INT_MAX, filename, linenumber); | ||
140 | result = malloc (size); | 139 | result = malloc (size); |
141 | if (result == NULL) | 140 | if (result == NULL) |
142 | return NULL; | 141 | return NULL; |
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c index 180aab4c3..31e777dc3 100644 --- a/src/util/container_bloomfilter.c +++ b/src/util/container_bloomfilter.c | |||
@@ -463,7 +463,8 @@ GNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size, | |||
463 | if (size < BUFFSIZE) | 463 | if (size < BUFFSIZE) |
464 | size = BUFFSIZE; | 464 | size = BUFFSIZE; |
465 | ui = 1; | 465 | ui = 1; |
466 | while (ui < size) | 466 | while ( (ui < size) && |
467 | (ui * 2 > ui) ) | ||
467 | ui *= 2; | 468 | ui *= 2; |
468 | size = ui; /* make sure it's a power of 2 */ | 469 | size = ui; /* make sure it's a power of 2 */ |
469 | 470 | ||