aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arm/arm_api.c7
-rw-r--r--src/conversation/conversation_api.c1
-rw-r--r--src/datacache/plugin_datacache_postgres.c4
-rw-r--r--src/datacache/plugin_datacache_sqlite.c2
-rw-r--r--src/datastore/datastore_api.c4
-rw-r--r--src/datastore/plugin_datastore_mysql.c2
-rw-r--r--src/datastore/plugin_datastore_postgres.c2
-rw-r--r--src/datastore/plugin_datastore_sqlite.c4
-rw-r--r--src/gns/gnunet-gns-proxy.c2
-rw-r--r--src/hostlist/hostlist.conf2
-rw-r--r--src/identity/identity_api.c4
-rw-r--r--src/identity/plugin_rest_identity.c26
-rw-r--r--src/include/Makefile.am1
-rw-r--r--src/include/gnunet_container_lib.h3
-rw-r--r--src/messenger/gnunet-service-messenger_member.c1
-rw-r--r--src/messenger/gnunet-service-messenger_room.c1
-rw-r--r--src/namecache/namecache_api.c1
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c12
-rw-r--r--src/namestore/plugin_rest_namestore.c6
-rw-r--r--src/rest/plugin_rest_config.c14
-rw-r--r--src/revocation/gnunet-service-revocation.c1
-rw-r--r--src/setu/gnunet-service-setu.c62
-rw-r--r--src/setu/ibf.c10
-rw-r--r--src/testing/Makefile.am2
-rw-r--r--src/transport/Makefile.am2
-rw-r--r--src/util/client.c1
-rw-r--r--src/util/configuration.c1
-rw-r--r--src/util/crypto_hkdf.c6
-rw-r--r--src/util/disk.c1
-rw-r--r--src/util/network.c2
-rw-r--r--src/util/os_priority.c10
-rw-r--r--src/util/strings.c2
-rw-r--r--src/vpn/Makefile.am5
-rw-r--r--src/vpn/gnunet-helper-vpn.c11
34 files changed, 123 insertions, 92 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index afc32fc3a..5fcbfb0a9 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -977,9 +977,12 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
977 { 977 {
978 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, 978 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
979 "pipe"); 979 "pipe");
980 } else { 980 ret = GNUNET_ARM_RESULT_START_FAILED;
981 }
982 else
983 {
981 wsig = GNUNET_DISK_pipe_detach_end (sig, 984 wsig = GNUNET_DISK_pipe_detach_end (sig,
982 GNUNET_DISK_PIPE_END_WRITE); 985 GNUNET_DISK_PIPE_END_WRITE);
983 ret = start_arm_service (h, 986 ret = start_arm_service (h,
984 std_inheritance, 987 std_inheritance,
985 wsig); 988 wsig);
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c
index 88fe8f11c..1984abdd6 100644
--- a/src/conversation/conversation_api.c
+++ b/src/conversation/conversation_api.c
@@ -645,6 +645,7 @@ GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
645 GNUNET_CRYPTO_hash (line, 645 GNUNET_CRYPTO_hash (line,
646 strlen (line), 646 strlen (line),
647 &line_port); 647 &line_port);
648 GNUNET_free (line);
648 phone = GNUNET_new (struct GNUNET_CONVERSATION_Phone); 649 phone = GNUNET_new (struct GNUNET_CONVERSATION_Phone);
649 if (GNUNET_OK != 650 if (GNUNET_OK !=
650 GNUNET_CRYPTO_get_peer_identity (cfg, 651 GNUNET_CRYPTO_get_peer_identity (cfg,
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c
index 724324ca4..6613ae928 100644
--- a/src/datacache/plugin_datacache_postgres.c
+++ b/src/datacache/plugin_datacache_postgres.c
@@ -306,7 +306,7 @@ postgres_plugin_get (void *cls,
306{ 306{
307 struct Plugin *plugin = cls; 307 struct Plugin *plugin = cls;
308 uint32_t type32 = (uint32_t) type; 308 uint32_t type32 = (uint32_t) type;
309 struct GNUNET_TIME_Absolute now; 309 struct GNUNET_TIME_Absolute now = { 0 };
310 struct GNUNET_PQ_QueryParam paramk[] = { 310 struct GNUNET_PQ_QueryParam paramk[] = {
311 GNUNET_PQ_query_param_auto_from_type (key), 311 GNUNET_PQ_query_param_auto_from_type (key),
312 GNUNET_PQ_query_param_absolute_time (&now), 312 GNUNET_PQ_query_param_absolute_time (&now),
@@ -424,7 +424,7 @@ postgres_plugin_get_random (void *cls,
424{ 424{
425 struct Plugin *plugin = cls; 425 struct Plugin *plugin = cls;
426 uint32_t off; 426 uint32_t off;
427 struct GNUNET_TIME_Absolute now; 427 struct GNUNET_TIME_Absolute now = { 0 };
428 struct GNUNET_TIME_Absolute expiration_time; 428 struct GNUNET_TIME_Absolute expiration_time;
429 size_t data_size; 429 size_t data_size;
430 void *data; 430 void *data;
diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c
index a7da6b068..66ff9e82c 100644
--- a/src/datacache/plugin_datacache_sqlite.c
+++ b/src/datacache/plugin_datacache_sqlite.c
@@ -468,7 +468,7 @@ sqlite_plugin_get_random (void *cls,
468 struct GNUNET_TIME_Absolute exp; 468 struct GNUNET_TIME_Absolute exp;
469 size_t size; 469 size_t size;
470 void *dat; 470 void *dat;
471 uint32_t off; 471 uint32_t off = 0;
472 size_t psize; 472 size_t psize;
473 uint32_t type; 473 uint32_t type;
474 struct GNUNET_PeerIdentity *path; 474 struct GNUNET_PeerIdentity *path;
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index d658b9c85..a49bc8586 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -1400,7 +1400,7 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h,
1400 LOG (GNUNET_ERROR_TYPE_DEBUG, 1400 LOG (GNUNET_ERROR_TYPE_DEBUG,
1401 "Asked to look for data of type %u under key `%s'\n", 1401 "Asked to look for data of type %u under key `%s'\n",
1402 (unsigned int) type, 1402 (unsigned int) type,
1403 GNUNET_h2s (key)); 1403 (NULL != key) ? GNUNET_h2s (key) : "NULL");
1404 if (NULL == key) 1404 if (NULL == key)
1405 { 1405 {
1406 env = GNUNET_MQ_msg (gm, 1406 env = GNUNET_MQ_msg (gm,
@@ -1430,7 +1430,7 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h,
1430 { 1430 {
1431 LOG (GNUNET_ERROR_TYPE_DEBUG, 1431 LOG (GNUNET_ERROR_TYPE_DEBUG,
1432 "Could not queue request for `%s'\n", 1432 "Could not queue request for `%s'\n",
1433 GNUNET_h2s (key)); 1433 (NULL != key) ? GNUNET_h2s (key): "NULL");
1434 return NULL; 1434 return NULL;
1435 } 1435 }
1436#if INSANE_STATISTICS 1436#if INSANE_STATISTICS
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c
index 4f0e0838e..216a6faa4 100644
--- a/src/datastore/plugin_datastore_mysql.c
+++ b/src/datastore/plugin_datastore_mysql.c
@@ -994,7 +994,7 @@ mysql_plugin_get_expiration (void *cls,
994 void *proc_cls) 994 void *proc_cls)
995{ 995{
996 struct Plugin *plugin = cls; 996 struct Plugin *plugin = cls;
997 struct GNUNET_TIME_Absolute now; 997 struct GNUNET_TIME_Absolute now = { 0 };
998 struct GNUNET_MY_QueryParam params_select[] = { 998 struct GNUNET_MY_QueryParam params_select[] = {
999 GNUNET_MY_query_param_absolute_time (&now), 999 GNUNET_MY_query_param_absolute_time (&now),
1000 GNUNET_MY_query_param_end 1000 GNUNET_MY_query_param_end
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index 66929f91a..8fb0bf6ee 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -729,7 +729,7 @@ postgres_plugin_get_expiration (void *cls,
729 void *proc_cls) 729 void *proc_cls)
730{ 730{
731 struct Plugin *plugin = cls; 731 struct Plugin *plugin = cls;
732 struct GNUNET_TIME_Absolute now; 732 struct GNUNET_TIME_Absolute now = { 0 };
733 struct GNUNET_PQ_QueryParam params[] = { 733 struct GNUNET_PQ_QueryParam params[] = {
734 GNUNET_PQ_query_param_absolute_time (&now), 734 GNUNET_PQ_query_param_absolute_time (&now),
735 GNUNET_PQ_query_param_end 735 GNUNET_PQ_query_param_end
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c
index f58955b7b..3c2d7f2d4 100644
--- a/src/datastore/plugin_datastore_sqlite.c
+++ b/src/datastore/plugin_datastore_sqlite.c
@@ -1029,7 +1029,7 @@ sqlite_plugin_get_replication (void *cls,
1029{ 1029{
1030 struct Plugin *plugin = cls; 1030 struct Plugin *plugin = cls;
1031 struct ReplCtx rc; 1031 struct ReplCtx rc;
1032 uint64_t rvalue; 1032 uint64_t rvalue = 0;
1033 uint32_t repl; 1033 uint32_t repl;
1034 struct GNUNET_SQ_QueryParam params_sel_repl[] = 1034 struct GNUNET_SQ_QueryParam params_sel_repl[] =
1035 { GNUNET_SQ_query_param_uint64 (&rvalue), 1035 { GNUNET_SQ_query_param_uint64 (&rvalue),
@@ -1096,7 +1096,7 @@ sqlite_plugin_get_expiration (void *cls,
1096{ 1096{
1097 struct Plugin *plugin = cls; 1097 struct Plugin *plugin = cls;
1098 sqlite3_stmt *stmt; 1098 sqlite3_stmt *stmt;
1099 struct GNUNET_TIME_Absolute now; 1099 struct GNUNET_TIME_Absolute now = { 0 };
1100 struct GNUNET_SQ_QueryParam params[] = { GNUNET_SQ_query_param_absolute_time ( 1100 struct GNUNET_SQ_QueryParam params[] = { GNUNET_SQ_query_param_absolute_time (
1101 &now), 1101 &now),
1102 GNUNET_SQ_query_param_end }; 1102 GNUNET_SQ_query_param_end };
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 5e3f9d6df..ec9fb12ae 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1264,7 +1264,7 @@ curl_check_hdr (void *buffer,
1264 } 1264 }
1265 GNUNET_free (leho_host); 1265 GNUNET_free (leho_host);
1266 } 1266 }
1267 if (0 == strcasecmp (MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, 1267 else if (0 == strcasecmp (MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
1268 hdr_type)) 1268 hdr_type))
1269 { 1269 {
1270 char *leho_host; 1270 char *leho_host;
diff --git a/src/hostlist/hostlist.conf b/src/hostlist/hostlist.conf
index 0a31a23ad..d994ce9fb 100644
--- a/src/hostlist/hostlist.conf
+++ b/src/hostlist/hostlist.conf
@@ -20,7 +20,7 @@ HOSTLISTFILE = $GNUNET_CONFIG_HOME/hostlist/learned.txt
20OPTIONS = -b 20OPTIONS = -b
21 21
22# Default list of hostlist servers for bootstrapping 22# Default list of hostlist servers for bootstrapping
23SERVERS = http://v14.gnunet.org/hostlist https://gnunet.io/hostlist 23SERVERS = http://v15.gnunet.org/hostlist https://gnunet.io/hostlist
24# http://silent.0xdeadc0de.eu:8080/ 24# http://silent.0xdeadc0de.eu:8080/
25 25
26# bind hostlist http server to a specific IPv4 26# bind hostlist http server to a specific IPv4
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index 3bbe0b957..22371f91a 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -1236,14 +1236,12 @@ GNUNET_IDENTITY_public_key_from_string (const char *str,
1236 struct GNUNET_IDENTITY_PublicKey *key) 1236 struct GNUNET_IDENTITY_PublicKey *key)
1237{ 1237{
1238 enum GNUNET_GenericReturnValue ret; 1238 enum GNUNET_GenericReturnValue ret;
1239 enum GNUNET_IDENTITY_KeyType ktype;
1240 ret = GNUNET_STRINGS_string_to_data (str, 1239 ret = GNUNET_STRINGS_string_to_data (str,
1241 strlen (str), 1240 strlen (str),
1242 key, 1241 key,
1243 sizeof (*key)); 1242 sizeof (*key));
1244 if (GNUNET_OK != ret) 1243 if (GNUNET_OK != ret)
1245 return GNUNET_SYSERR; 1244 return GNUNET_SYSERR;
1246 ktype = ntohl (key->type);
1247 return GNUNET_OK; 1245 return GNUNET_OK;
1248 1246
1249} 1247}
@@ -1254,14 +1252,12 @@ GNUNET_IDENTITY_private_key_from_string (const char *str,
1254 struct GNUNET_IDENTITY_PrivateKey *key) 1252 struct GNUNET_IDENTITY_PrivateKey *key)
1255{ 1253{
1256 enum GNUNET_GenericReturnValue ret; 1254 enum GNUNET_GenericReturnValue ret;
1257 enum GNUNET_IDENTITY_KeyType ktype;
1258 ret = GNUNET_STRINGS_string_to_data (str, 1255 ret = GNUNET_STRINGS_string_to_data (str,
1259 strlen (str), 1256 strlen (str),
1260 key, 1257 key,
1261 sizeof (*key)); 1258 sizeof (*key));
1262 if (GNUNET_OK != ret) 1259 if (GNUNET_OK != ret)
1263 return GNUNET_SYSERR; 1260 return GNUNET_SYSERR;
1264 ktype = ntohl (key->type);
1265 return GNUNET_OK; 1261 return GNUNET_OK;
1266} 1262}
1267 1263
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index dba1d478d..d7cd0e826 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -322,7 +322,9 @@ do_error (void *cls)
322 handle->response_code = MHD_HTTP_OK; 322 handle->response_code = MHD_HTTP_OK;
323 response = json_dumps (json_error, 0); 323 response = json_dumps (json_error, 0);
324 resp = GNUNET_REST_create_response (response); 324 resp = GNUNET_REST_create_response (response);
325 MHD_add_response_header (resp, "Content-Type", "application/json"); 325 GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
326 "Content-Type",
327 "application/json"));
326 handle->proc (handle->proc_cls, resp, handle->response_code); 328 handle->proc (handle->proc_cls, resp, handle->response_code);
327 json_decref (json_error); 329 json_decref (json_error);
328 GNUNET_free (response); 330 GNUNET_free (response);
@@ -412,7 +414,9 @@ ego_get_for_subsystem (void *cls,
412 result_str = json_dumps (json_root, 0); 414 result_str = json_dumps (json_root, 0);
413 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str); 415 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str);
414 resp = GNUNET_REST_create_response (result_str); 416 resp = GNUNET_REST_create_response (result_str);
415 MHD_add_response_header (resp, "Content-Type", "application/json"); 417 GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
418 "Content-Type",
419 "application/json"));
416 json_decref (json_root); 420 json_decref (json_root);
417 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 421 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
418 GNUNET_free (result_str); 422 GNUNET_free (result_str);
@@ -514,7 +518,9 @@ ego_get_all (struct GNUNET_REST_RequestHandle *con_handle,
514 result_str = json_dumps (json_root, 0); 518 result_str = json_dumps (json_root, 0);
515 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str); 519 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str);
516 resp = GNUNET_REST_create_response (result_str); 520 resp = GNUNET_REST_create_response (result_str);
517 MHD_add_response_header (resp, "Content-Type", "application/json"); 521 GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
522 "Content-Type",
523 "application/json"));
518 json_decref (json_root); 524 json_decref (json_root);
519 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 525 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
520 GNUNET_free (result_str); 526 GNUNET_free (result_str);
@@ -561,7 +567,9 @@ ego_get_response (struct RequestHandle *handle, struct EgoEntry *ego_entry)
561 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str); 567 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str);
562 resp = GNUNET_REST_create_response (result_str); 568 resp = GNUNET_REST_create_response (result_str);
563 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 569 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
564 MHD_add_response_header (resp, "Content-Type", "application/json"); 570 GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
571 "Content-Type",
572 "application/json"));
565 json_decref (json_ego); 573 json_decref (json_ego);
566 GNUNET_free (result_str); 574 GNUNET_free (result_str);
567 GNUNET_SCHEDULER_add_now (&cleanup_handle, handle); 575 GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
@@ -1195,7 +1203,9 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle,
1195 1203
1196 // For now, independent of path return all options 1204 // For now, independent of path return all options
1197 resp = GNUNET_REST_create_response (NULL); 1205 resp = GNUNET_REST_create_response (NULL);
1198 MHD_add_response_header (resp, "Access-Control-Allow-Methods", allow_methods); 1206 GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
1207 "Access-Control-Allow-Methods",
1208 allow_methods));
1199 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 1209 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
1200 GNUNET_SCHEDULER_add_now (&cleanup_handle, handle); 1210 GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
1201 return; 1211 return;
@@ -1216,6 +1226,12 @@ list_ego (void *cls,
1216 state = ID_REST_STATE_POST_INIT; 1226 state = ID_REST_STATE_POST_INIT;
1217 return; 1227 return;
1218 } 1228 }
1229 if (NULL == ego)
1230 {
1231 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1232 "Called with NULL ego\n");
1233 return;
1234 }
1219 if (ID_REST_STATE_INIT == state) 1235 if (ID_REST_STATE_INIT == state)
1220 { 1236 {
1221 ego_entry = GNUNET_new (struct EgoEntry); 1237 ego_entry = GNUNET_new (struct EgoEntry);
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index d15186342..16ff25350 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -117,6 +117,7 @@ gnunetinclude_HEADERS = \
117 gnunet_testbed_logger_service.h \ 117 gnunet_testbed_logger_service.h \
118 gnunet_testbed_ng_service.h \ 118 gnunet_testbed_ng_service.h \
119 gnunet_testing_lib.h \ 119 gnunet_testing_lib.h \
120 gnunet_testing_plugin.h \
120 gnunet_testing_ng_lib.h \ 121 gnunet_testing_ng_lib.h \
121 gnunet_time_lib.h \ 122 gnunet_time_lib.h \
122 gnunet_transport_service.h \ 123 gnunet_transport_service.h \
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index c8930746d..3eb80595c 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -2608,7 +2608,8 @@ GNUNET_CONTAINER_heap_node_get_cost (
2608 * @return #GNUNET_YES if we should continue to iterate, 2608 * @return #GNUNET_YES if we should continue to iterate,
2609 * #GNUNET_NO if not. 2609 * #GNUNET_NO if not.
2610 */ 2610 */
2611typedef int (*GNUNET_CONTAINER_HeapIterator) ( 2611typedef int
2612(*GNUNET_CONTAINER_HeapIterator) (
2612 void *cls, 2613 void *cls,
2613 struct GNUNET_CONTAINER_HeapNode *node, 2614 struct GNUNET_CONTAINER_HeapNode *node,
2614 void *element, 2615 void *element,
diff --git a/src/messenger/gnunet-service-messenger_member.c b/src/messenger/gnunet-service-messenger_member.c
index 7f00e8438..b0a735dbe 100644
--- a/src/messenger/gnunet-service-messenger_member.c
+++ b/src/messenger/gnunet-service-messenger_member.c
@@ -88,6 +88,7 @@ callback_scan_for_sessions (void *cls, const char *filename)
88 GNUNET_asprintf (&directory, "%s%c", filename, DIR_SEPARATOR); 88 GNUNET_asprintf (&directory, "%s%c", filename, DIR_SEPARATOR);
89 89
90 load_member_session(member, directory); 90 load_member_session(member, directory);
91 GNUNET_free (directory);
91 } 92 }
92 93
93 return GNUNET_OK; 94 return GNUNET_OK;
diff --git a/src/messenger/gnunet-service-messenger_room.c b/src/messenger/gnunet-service-messenger_room.c
index c3a5e3a4b..73e94908f 100644
--- a/src/messenger/gnunet-service-messenger_room.c
+++ b/src/messenger/gnunet-service-messenger_room.c
@@ -1144,6 +1144,7 @@ load_room (struct GNUNET_MESSENGER_SrvRoom *room)
1144 GNUNET_asprintf (&last_messages_file, "%s%s", room_dir, "last_messages.list"); 1144 GNUNET_asprintf (&last_messages_file, "%s%s", room_dir, "last_messages.list");
1145 1145
1146 load_message_state(&(room->state), room_dir); 1146 load_message_state(&(room->state), room_dir);
1147 GNUNET_free (last_messages_file);
1147 } 1148 }
1148 1149
1149 GNUNET_free(room_dir); 1150 GNUNET_free(room_dir);
diff --git a/src/namecache/namecache_api.c b/src/namecache/namecache_api.c
index fdbf142a7..70c848037 100644
--- a/src/namecache/namecache_api.c
+++ b/src/namecache/namecache_api.c
@@ -228,6 +228,7 @@ handle_lookup_block_response (void *cls,
228 char buf[size] GNUNET_ALIGN; 228 char buf[size] GNUNET_ALIGN;
229 struct GNUNET_GNSRECORD_Block *block; 229 struct GNUNET_GNSRECORD_Block *block;
230 230
231 memset (buf, 0, size);
231 block = (struct GNUNET_GNSRECORD_Block *) buf; 232 block = (struct GNUNET_GNSRECORD_Block *) buf;
232 GNUNET_memcpy (block, 233 GNUNET_memcpy (block,
233 &msg[1], 234 &msg[1],
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index 847f7cb64..95d4c5878 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -185,15 +185,15 @@ do_shutdown (void *cls)
185 } 185 }
186 if (NULL != notfound_page) 186 if (NULL != notfound_page)
187 { 187 {
188 MHD_destroy_response (main_page->response); 188 MHD_destroy_response (notfound_page->response);
189 GNUNET_free (main_page->handle); 189 GNUNET_free (notfound_page->handle);
190 GNUNET_free (main_page); 190 GNUNET_free (notfound_page);
191 } 191 }
192 if (NULL != forbidden_page) 192 if (NULL != forbidden_page)
193 { 193 {
194 MHD_destroy_response (main_page->response); 194 MHD_destroy_response (forbidden_page->response);
195 GNUNET_free (main_page->handle); 195 GNUNET_free (forbidden_page->handle);
196 GNUNET_free (main_page); 196 GNUNET_free (forbidden_page);
197 } 197 }
198 198
199 if (NULL != namestore) 199 if (NULL != namestore)
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c
index ae93e5eff..ff5494dc7 100644
--- a/src/namestore/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
@@ -955,6 +955,12 @@ list_ego (void *cls,
955 state = ID_REST_STATE_POST_INIT; 955 state = ID_REST_STATE_POST_INIT;
956 return; 956 return;
957 } 957 }
958 if (NULL == ego)
959 {
960 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
961 "Called with NULL ego\n");
962 return;
963 }
958 if (ID_REST_STATE_INIT == state) 964 if (ID_REST_STATE_INIT == state)
959 { 965 {
960 ego_entry = GNUNET_new (struct EgoEntry); 966 ego_entry = GNUNET_new (struct EgoEntry);
diff --git a/src/rest/plugin_rest_config.c b/src/rest/plugin_rest_config.c
index af833efff..b0f18754c 100644
--- a/src/rest/plugin_rest_config.c
+++ b/src/rest/plugin_rest_config.c
@@ -91,7 +91,6 @@ static struct RequestHandle *requests_head;
91static struct RequestHandle *requests_tail; 91static struct RequestHandle *requests_tail;
92 92
93 93
94
95/** 94/**
96 * Cleanup request handle. 95 * Cleanup request handle.
97 * 96 *
@@ -199,7 +198,9 @@ get_cont (struct GNUNET_REST_RequestHandle *con_handle,
199 } 198 }
200 response = json_dumps (result, 0); 199 response = json_dumps (result, 0);
201 resp = GNUNET_REST_create_response (response); 200 resp = GNUNET_REST_create_response (response);
202 MHD_add_response_header (resp, "Content-Type", "application/json"); 201 GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
202 "Content-Type",
203 "application/json"));
203 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 204 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
204 cleanup_handle (handle); 205 cleanup_handle (handle);
205 GNUNET_free (response); 206 GNUNET_free (response);
@@ -334,6 +335,7 @@ set_cont (struct GNUNET_REST_RequestHandle *con_handle,
334 handle->proc (handle->proc_cls, 335 handle->proc (handle->proc_cls,
335 GNUNET_REST_create_response (NULL), 336 GNUNET_REST_create_response (NULL),
336 MHD_HTTP_OK); 337 MHD_HTTP_OK);
338 GNUNET_free (cfg_fn);
337 cleanup_handle (handle); 339 cleanup_handle (handle);
338} 340}
339 341
@@ -352,9 +354,9 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle,
352 struct RequestHandle *handle = cls; 354 struct RequestHandle *handle = cls;
353 355
354 resp = GNUNET_REST_create_response (NULL); 356 resp = GNUNET_REST_create_response (NULL);
355 MHD_add_response_header (resp, 357 GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
356 "Access-Control-Allow-Methods", 358 "Access-Control-Allow-Methods",
357 MHD_HTTP_METHOD_GET); 359 MHD_HTTP_METHOD_GET));
358 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 360 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
359 cleanup_handle (handle); 361 cleanup_handle (handle);
360} 362}
@@ -424,7 +426,7 @@ libgnunet_plugin_rest_config_init (void *cls)
424 api->cls = &plugin; 426 api->cls = &plugin;
425 api->name = GNUNET_REST_API_NS_CONFIG; 427 api->name = GNUNET_REST_API_NS_CONFIG;
426 api->process_request = &rest_config_process_request; 428 api->process_request = &rest_config_process_request;
427 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("CONFIG REST API initialized\n")); 429 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _ ("CONFIG REST API initialized\n"));
428 return api; 430 return api;
429} 431}
430 432
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index 2d8111adb..5fe0ade98 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -949,6 +949,7 @@ run (void *cls,
949 if (0 > ksize) 949 if (0 > ksize)
950 { 950 {
951 GNUNET_break_op (0); 951 GNUNET_break_op (0);
952 GNUNET_free (rm);
952 GNUNET_free (fn); 953 GNUNET_free (fn);
953 return; 954 return;
954 } 955 }
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index b01b897d8..339d347f8 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -1119,15 +1119,16 @@ estimate_best_mode_of_operation (uint64_t avg_element_size,
1119 ibf_bucket_count = IBF_MIN_SIZE; 1119 ibf_bucket_count = IBF_MIN_SIZE;
1120 } 1120 }
1121 uint64_t ibf_message_count = ceil ( ((float) ibf_bucket_count) 1121 uint64_t ibf_message_count = ceil ( ((float) ibf_bucket_count)
1122 / MAX_BUCKETS_PER_MESSAGE); 1122 / ((float) MAX_BUCKETS_PER_MESSAGE));
1123 1123
1124 uint64_t estimated_counter_size = ceil ( 1124 uint64_t estimated_counter_size = ceil (
1125 MIN (2 * log2l ((float) local_set_size / ibf_bucket_count), log2l ( 1125 MIN (2 * log2l (((float) local_set_size)
1126 local_set_size))); 1126 / ((float) ibf_bucket_count)),
1127 log2l (local_set_size)));
1127 1128
1128 long double counter_bytes = (float) estimated_counter_size / 8; 1129 long double counter_bytes = (float) estimated_counter_size / 8;
1129 1130
1130 uint64_t ibf_bytes = ceil ((sizeof(struct IBFMessage) * ibf_message_count) 1131 uint64_t ibf_bytes = ceil ((sizeof (struct IBFMessage) * ibf_message_count)
1131 * 1.2 \ 1132 * 1.2 \
1132 + (ibf_bucket_count * sizeof(struct IBF_Key)) * 1.2 \ 1133 + (ibf_bucket_count * sizeof(struct IBF_Key)) * 1.2 \
1133 + (ibf_bucket_count * sizeof(struct IBF_KeyHash)) 1134 + (ibf_bucket_count * sizeof(struct IBF_KeyHash))
@@ -1135,18 +1136,18 @@ estimate_best_mode_of_operation (uint64_t avg_element_size,
1135 + (ibf_bucket_count * counter_bytes) * 1.2); 1136 + (ibf_bucket_count * counter_bytes) * 1.2);
1136 1137
1137 /* Estimate full byte count for differential sync */ 1138 /* Estimate full byte count for differential sync */
1138 uint64_t element_size = (avg_element_size + sizeof(struct 1139 uint64_t element_size = (avg_element_size
1139 GNUNET_SETU_ElementMessage)) \ 1140 + sizeof (struct GNUNET_SETU_ElementMessage)) \
1140 * estimated_total_diff; 1141 * estimated_total_diff;
1141 uint64_t done_size = sizeof_done_header; 1142 uint64_t done_size = sizeof_done_header;
1142 uint64_t inquery_size = (sizeof(struct IBF_Key) + sizeof(struct 1143 uint64_t inquery_size = (sizeof (struct IBF_Key)
1143 InquiryMessage)) 1144 + sizeof (struct InquiryMessage))
1144 * estimated_total_diff; 1145 * estimated_total_diff;
1145 uint64_t demand_size = 1146 uint64_t demand_size =
1146 (sizeof(struct GNUNET_HashCode) + sizeof(struct GNUNET_MessageHeader)) 1147 (sizeof(struct GNUNET_HashCode) + sizeof(struct GNUNET_MessageHeader))
1147 * estimated_total_diff; 1148 * estimated_total_diff;
1148 uint64_t offer_size = (sizeof(struct GNUNET_HashCode) + sizeof(struct 1149 uint64_t offer_size = (sizeof (struct GNUNET_HashCode)
1149 GNUNET_MessageHeader)) 1150 + sizeof (struct GNUNET_MessageHeader))
1150 * estimated_total_diff; 1151 * estimated_total_diff;
1151 1152
1152 uint64_t total_bytes_diff = (element_size + done_size + inquery_size 1153 uint64_t total_bytes_diff = (element_size + done_size + inquery_size
@@ -1183,12 +1184,13 @@ estimate_best_mode_of_operation (uint64_t avg_element_size,
1183 * @param allowed_phases 1184 * @param allowed_phases
1184 * @param size_phases 1185 * @param size_phases
1185 * @param op 1186 * @param op
1186 * @return GNUNET_YES if message permitted in phase and GNUNET_NO if not permitted in given 1187 * @return #GNUNET_YES if message permitted in phase and #GNUNET_NO if not permitted in given
1187 * phase 1188 * phase
1188 */ 1189 */
1189static int 1190static enum GNUNET_GenericReturnValue
1190check_valid_phase (const uint8_t allowed_phases[], size_t size_phases, struct 1191check_valid_phase (const uint8_t allowed_phases[],
1191 Operation *op) 1192 size_t size_phases,
1193 struct Operation *op)
1192{ 1194{
1193 /** 1195 /**
1194 * Iterate over allowed phases 1196 * Iterate over allowed phases
@@ -2146,11 +2148,15 @@ send_ibf (struct Operation *op,
2146 2148
2147 LOG (GNUNET_ERROR_TYPE_DEBUG, 2149 LOG (GNUNET_ERROR_TYPE_DEBUG,
2148 "sending ibf of size %u\n", 2150 "sending ibf of size %u\n",
2149 1 << ibf_size); 2151 (unsigned int) ibf_size);
2150 2152
2151 { 2153 {
2152 char name[64]; 2154 char name[64];
2153 GNUNET_snprintf (name, sizeof(name), "# sent IBF (order %u)", ibf_size); 2155
2156 GNUNET_snprintf (name,
2157 sizeof(name),
2158 "# sent IBF (order %u)",
2159 ibf_size);
2154 GNUNET_STATISTICS_update (_GSS_statistics, name, 1, GNUNET_NO); 2160 GNUNET_STATISTICS_update (_GSS_statistics, name, 1, GNUNET_NO);
2155 } 2161 }
2156 2162
@@ -4111,26 +4117,20 @@ handle_union_p2p_offer (void *cls,
4111 perf_store.demand.sent += 1; 4117 perf_store.demand.sent += 1;
4112 perf_store.demand.sent_var_bytes += sizeof(struct GNUNET_HashCode); 4118 perf_store.demand.sent_var_bytes += sizeof(struct GNUNET_HashCode);
4113#endif 4119#endif
4114 ev = GNUNET_MQ_msg_header_extra (demands,
4115 sizeof(struct GNUNET_HashCode),
4116 GNUNET_MESSAGE_TYPE_SETU_P2P_DEMAND);
4117 /* Save send demand message for message control */ 4120 /* Save send demand message for message control */
4118 if (GNUNET_YES != 4121 if (GNUNET_YES !=
4119 update_message_control_flow ( 4122 update_message_control_flow (
4120 op->message_control_flow, 4123 op->message_control_flow,
4121 MSG_CFS_SENT, 4124 MSG_CFS_SENT,
4122 hash, 4125 hash,
4123 DEMAND_MESSAGE) 4126 DEMAND_MESSAGE))
4124 )
4125 { 4127 {
4126 // GNUNET_free (ev);
4127 LOG (GNUNET_ERROR_TYPE_ERROR, 4128 LOG (GNUNET_ERROR_TYPE_ERROR,
4128 "Double demand message sent found!\n"); 4129 "Double demand message sent found!\n");
4129 GNUNET_break (0); 4130 GNUNET_break (0);
4130 fail_union_operation (op); 4131 fail_union_operation (op);
4131 return; 4132 return;
4132 } 4133 }
4133 ;
4134 4134
4135 /* Mark offer as received received */ 4135 /* Mark offer as received received */
4136 if (GNUNET_YES != 4136 if (GNUNET_YES !=
@@ -4138,37 +4138,31 @@ handle_union_p2p_offer (void *cls,
4138 op->message_control_flow, 4138 op->message_control_flow,
4139 MSG_CFS_RECEIVED, 4139 MSG_CFS_RECEIVED,
4140 hash, 4140 hash,
4141 OFFER_MESSAGE) 4141 OFFER_MESSAGE))
4142 )
4143 { 4142 {
4144 // GNUNET_free (ev);
4145 LOG (GNUNET_ERROR_TYPE_ERROR, 4143 LOG (GNUNET_ERROR_TYPE_ERROR,
4146 "Double offer message received found!\n"); 4144 "Double offer message received found!\n");
4147 GNUNET_break (0); 4145 GNUNET_break (0);
4148 fail_union_operation (op); 4146 fail_union_operation (op);
4149 return; 4147 return;
4150 } 4148 }
4151 ;
4152
4153 /* Mark element to be expected to received */ 4149 /* Mark element to be expected to received */
4154 if (GNUNET_YES != 4150 if (GNUNET_YES !=
4155 update_message_control_flow ( 4151 update_message_control_flow (
4156 op->message_control_flow, 4152 op->message_control_flow,
4157 MSG_CFS_EXPECTED, 4153 MSG_CFS_EXPECTED,
4158 hash, 4154 hash,
4159 ELEMENT_MESSAGE) 4155 ELEMENT_MESSAGE))
4160 )
4161 { 4156 {
4162 // GNUNET_free (ev);
4163 LOG (GNUNET_ERROR_TYPE_ERROR, 4157 LOG (GNUNET_ERROR_TYPE_ERROR,
4164 "Element already expected!\n"); 4158 "Element already expected!\n");
4165 GNUNET_break (0); 4159 GNUNET_break (0);
4166 fail_union_operation (op); 4160 fail_union_operation (op);
4167 return; 4161 return;
4168 } 4162 }
4169 ; 4163 ev = GNUNET_MQ_msg_header_extra (demands,
4170 4164 sizeof(struct GNUNET_HashCode),
4171 4165 GNUNET_MESSAGE_TYPE_SETU_P2P_DEMAND);
4172 GNUNET_memcpy (&demands[1], 4166 GNUNET_memcpy (&demands[1],
4173 hash, 4167 hash,
4174 sizeof(struct GNUNET_HashCode)); 4168 sizeof(struct GNUNET_HashCode));
diff --git a/src/setu/ibf.c b/src/setu/ibf.c
index 8f29adb62..dbd23c320 100644
--- a/src/setu/ibf.c
+++ b/src/setu/ibf.c
@@ -462,11 +462,11 @@ unpack_counter (const struct InvertibleBloomFilter *ibf,
462 /** 462 /**
463 * Pack data left in story before finishing 463 * Pack data left in story before finishing
464 */ 464 */
465 while (bit_to_read_left >= 0) 465 while (true)
466 { 466 {
467 /** 467 /**
468 * Stop decoding when end is reached 468 * Stop decoding when end is reached
469 */ 469 */
470 if (ibf_counter_ctr > (count - 1)) 470 if (ibf_counter_ctr > (count - 1))
471 return; 471 return;
472 472
@@ -504,13 +504,9 @@ unpack_counter (const struct InvertibleBloomFilter *ibf,
504 store = store | byte_read; 504 store = store | byte_read;
505 } 505 }
506 break; 506 break;
507
508 } 507 }
509
510 } 508 }
511
512 } 509 }
513
514} 510}
515 511
516 512
diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index 868e3fcec..8b28e6e23 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -15,7 +15,7 @@ lib_LTLIBRARIES = \
15 libgnunettesting.la 15 libgnunettesting.la
16 16
17libgnunettesting_la_SOURCES = \ 17libgnunettesting_la_SOURCES = \
18 testing.c \ 18 testing.c testing.h \
19 testing_api_cmd_system_create.c \ 19 testing_api_cmd_system_create.c \
20 testing_api_cmd_batch.c \ 20 testing_api_cmd_batch.c \
21 testing_api_cmd_hello_world.c \ 21 testing_api_cmd_hello_world.c \
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index e19ebd8e9..0613f663d 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -647,7 +647,6 @@ endif
647if ENABLE_TEST_RUN 647if ENABLE_TEST_RUN
648AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; 648AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
649TESTS = \ 649TESTS = \
650 test_transport_api_cmd_simple_send \
651 test_transport_address_switch_tcp \ 650 test_transport_address_switch_tcp \
652 $(HTTP_SWITCH) \ 651 $(HTTP_SWITCH) \
653 $(HTTPS_SWITCH) \ 652 $(HTTPS_SWITCH) \
@@ -707,6 +706,7 @@ test_transport_api_slow_ats
707endif 706endif
708if HAVE_EXPERIMENTAL 707if HAVE_EXPERIMENTAL
709TESTS += \ 708TESTS += \
709 test_transport_api_cmd_simple_send \
710 test_transport_address_switch_udp \ 710 test_transport_address_switch_udp \
711 test_plugin_udp \ 711 test_plugin_udp \
712 test_transport_api_udp \ 712 test_transport_api_udp \
diff --git a/src/util/client.c b/src/util/client.c
index afd2fe900..4e5eca32a 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -745,6 +745,7 @@ test_service_configuration (const char *service_name,
745 service_name, 745 service_name,
746 "UNIXPATH", 746 "UNIXPATH",
747 _ ("not a valid filename")); 747 _ ("not a valid filename"));
748 GNUNET_free (unixpath);
748 return GNUNET_SYSERR; /* UNIXPATH specified but invalid! */ 749 return GNUNET_SYSERR; /* UNIXPATH specified but invalid! */
749 } 750 }
750 GNUNET_free (unixpath); 751 GNUNET_free (unixpath);
diff --git a/src/util/configuration.c b/src/util/configuration.c
index dff3c2e99..1aa52ad76 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -1007,6 +1007,7 @@ GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
1007 cf->source_filename, 1007 cf->source_filename,
1008 parent->source_filename, 1008 parent->source_filename,
1009 filename); 1009 filename);
1010 GNUNET_free (fn);
1010 return GNUNET_SYSERR; 1011 return GNUNET_SYSERR;
1011 } 1012 }
1012 } 1013 }
diff --git a/src/util/crypto_hkdf.c b/src/util/crypto_hkdf.c
index 86a814b12..7270b87b6 100644
--- a/src/util/crypto_hkdf.c
+++ b/src/util/crypto_hkdf.c
@@ -77,7 +77,11 @@ static const void *
77doHMAC (gcry_md_hd_t mac, const void *key, size_t key_len, const void *buf, 77doHMAC (gcry_md_hd_t mac, const void *key, size_t key_len, const void *buf,
78 size_t buf_len) 78 size_t buf_len)
79{ 79{
80 gcry_md_setkey (mac, key, key_len); 80 if (GPG_ERR_NO_ERROR != gcry_md_setkey (mac, key, key_len))
81 {
82 GNUNET_break (0);
83 return NULL;
84 }
81 gcry_md_write (mac, buf, buf_len); 85 gcry_md_write (mac, buf, buf_len);
82 86
83 return (const void *) gcry_md_read (mac, 0); 87 return (const void *) gcry_md_read (mac, 0);
diff --git a/src/util/disk.c b/src/util/disk.c
index ada35249f..2efb52d46 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1020,6 +1020,7 @@ GNUNET_DISK_glob (const char *glob_pattern,
1020 LOG (GNUNET_ERROR_TYPE_ERROR, 1020 LOG (GNUNET_ERROR_TYPE_ERROR,
1021 "unsupported glob pattern: '%s'\n", 1021 "unsupported glob pattern: '%s'\n",
1022 glob_pattern); 1022 glob_pattern);
1023 GNUNET_free (mypat);
1023 return -1; 1024 return -1;
1024 } 1025 }
1025 1026
diff --git a/src/util/network.c b/src/util/network.c
index e771a9834..61da37ab7 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -122,7 +122,7 @@ GNUNET_NETWORK_test_pf (int pf)
122 } 122 }
123 else 123 else
124 { 124 {
125 close (s); 125 GNUNET_break (0 == close (s));
126 ret = GNUNET_OK; 126 ret = GNUNET_OK;
127 } 127 }
128 switch (pf) 128 switch (pf)
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index 1ed9bcbf7..dc2f0f97e 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -316,7 +316,7 @@ open_dev_null (int target_fd, int flags)
316 if (-1 == dup2 (fd, target_fd)) 316 if (-1 == dup2 (fd, target_fd))
317 { 317 {
318 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2"); 318 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2");
319 (void) close (fd); 319 GNUNET_break (0 == close (fd));
320 return; 320 return;
321 } 321 }
322 GNUNET_break (0 == close (fd)); 322 GNUNET_break (0 == close (fd));
@@ -395,7 +395,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
395 if (NULL != childpipe_write) 395 if (NULL != childpipe_write)
396 GNUNET_DISK_file_close (childpipe_write); 396 GNUNET_DISK_file_close (childpipe_write);
397 if (0 <= dup_childpipe_read_fd) 397 if (0 <= dup_childpipe_read_fd)
398 close (dup_childpipe_read_fd); 398 GNUNET_break (0 == close (dup_childpipe_read_fd));
399 return NULL; 399 return NULL;
400 } 400 }
401 childpipe_read_fd = dup_childpipe_read_fd; 401 childpipe_read_fd = dup_childpipe_read_fd;
@@ -474,7 +474,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
474 if (NULL != childpipe_write) 474 if (NULL != childpipe_write)
475 GNUNET_DISK_file_close (childpipe_write); 475 GNUNET_DISK_file_close (childpipe_write);
476 if (0 <= childpipe_read_fd) 476 if (0 <= childpipe_read_fd)
477 close (childpipe_read_fd); 477 GNUNET_break (0 == close (childpipe_read_fd));
478 errno = eno; 478 errno = eno;
479 return NULL; 479 return NULL;
480 } 480 }
@@ -486,7 +486,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
486 gnunet_proc->control_pipe = childpipe_write; 486 gnunet_proc->control_pipe = childpipe_write;
487 if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL)) 487 if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL))
488 { 488 {
489 close (childpipe_read_fd); 489 GNUNET_break (0 == close (childpipe_read_fd));
490 } 490 }
491 GNUNET_array_grow (lscp, ls, 0); 491 GNUNET_array_grow (lscp, ls, 0);
492 return gnunet_proc; 492 return gnunet_proc;
@@ -564,7 +564,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
564 { 564 {
565 /* Bury any existing FD, no matter what; they should all be closed 565 /* Bury any existing FD, no matter what; they should all be closed
566 * on exec anyway and the important ones have been dup'ed away */ 566 * on exec anyway and the important ones have been dup'ed away */
567 (void) close (tgt); 567 GNUNET_break (0 == close (tgt));
568 GNUNET_assert (-1 != dup2 (lscp[i], tgt)); 568 GNUNET_assert (-1 != dup2 (lscp[i], tgt));
569 } 569 }
570 /* unset close-on-exec flag */ 570 /* unset close-on-exec flag */
diff --git a/src/util/strings.c b/src/util/strings.c
index 24335e444..673915888 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -1600,7 +1600,7 @@ GNUNET_STRINGS_base64_encode (const void *in,
1600 char *opt; 1600 char *opt;
1601 1601
1602 ret = 0; 1602 ret = 0;
1603 GNUNET_assert (len / 4 < SIZE_MAX); 1603 GNUNET_assert (len < SIZE_MAX / 4 * 3 );
1604 opt = GNUNET_malloc (2 + (len * 4 / 3) + 8); 1604 opt = GNUNET_malloc (2 + (len * 4 / 3) + 8);
1605 for (size_t i = 0; i < len; ++i) 1605 for (size_t i = 0; i < len; ++i)
1606 { 1606 {
diff --git a/src/vpn/Makefile.am b/src/vpn/Makefile.am
index d1ecd9f98..a5bbb6e22 100644
--- a/src/vpn/Makefile.am
+++ b/src/vpn/Makefile.am
@@ -31,7 +31,10 @@ bin_PROGRAMS = \
31 gnunet-vpn 31 gnunet-vpn
32 32
33gnunet_helper_vpn_SOURCES = \ 33gnunet_helper_vpn_SOURCES = \
34gnunet-helper-vpn.c 34 gnunet-helper-vpn.c
35gnunet_helper_vpn_LDADD = \
36 $(top_builddir)/src/util/libgnunetutil.la \
37 $(GN_LIBINTL)
35 38
36gnunet_service_vpn_SOURCES = \ 39gnunet_service_vpn_SOURCES = \
37 gnunet-service-vpn.c 40 gnunet-service-vpn.c
diff --git a/src/vpn/gnunet-helper-vpn.c b/src/vpn/gnunet-helper-vpn.c
index 7eeb07379..7686d51d5 100644
--- a/src/vpn/gnunet-helper-vpn.c
+++ b/src/vpn/gnunet-helper-vpn.c
@@ -246,7 +246,8 @@ set_address6 (const char *dev,
246 if (0 != close (fd)) 246 if (0 != close (fd))
247 { 247 {
248 fprintf (stderr, 248 fprintf (stderr,
249 "close failed: %s\n", 249 "close failed at line %d: %s\n",
250 __LINE__,
250 strerror (errno)); 251 strerror (errno));
251 exit (1); 252 exit (1);
252 } 253 }
@@ -367,9 +368,9 @@ set_address4 (const char *dev,
367 if (0 != close (fd)) 368 if (0 != close (fd))
368 { 369 {
369 fprintf (stderr, 370 fprintf (stderr,
370 "close failed: %s\n", 371 "close failed at line %d: %s\n",
372 __LINE__,
371 strerror (errno)); 373 strerror (errno));
372 (void) close (fd);
373 exit (1); 374 exit (1);
374 } 375 }
375} 376}
@@ -653,7 +654,7 @@ main (int argc, char **argv)
653 { 654 {
654 fprintf (stderr, 655 fprintf (stderr,
655 "Fatal: prefix_len out of range\n"); 656 "Fatal: prefix_len out of range\n");
656 close (fd_tun); 657 (void) close (fd_tun);
657 return 1; 658 return 1;
658 } 659 }
659 660
@@ -701,6 +702,6 @@ main (int argc, char **argv)
701 run (fd_tun); 702 run (fd_tun);
702 global_ret = 0; 703 global_ret = 0;
703cleanup: 704cleanup:
704 close (fd_tun); 705 (void) close (fd_tun);
705 return global_ret; 706 return global_ret;
706} 707}