aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-09-07 11:58:04 +0000
committerChristian Grothoff <christian@grothoff.org>2009-09-07 11:58:04 +0000
commit9dac7b6b7b035d55bdb9731795712ead92e11f76 (patch)
tree8bed4ad4617f95bcdaac75dc43c2b2dd461b3e76 /src
parent2a534fc5efadca1b65648efb903c3b4c17ac33ad (diff)
downloadgnunet-9dac7b6b7b035d55bdb9731795712ead92e11f76.tar.gz
gnunet-9dac7b6b7b035d55bdb9731795712ead92e11f76.zip
fixes
Diffstat (limited to 'src')
-rw-r--r--src/core/core_api.c2
-rw-r--r--src/core/gnunet-service-core.c1
-rw-r--r--src/datastore/gnunet-service-datastore.c1
-rw-r--r--src/fs/fs_directory.c21
-rw-r--r--src/fs/fs_download.c4
-rw-r--r--src/fs/fs_search.c4
-rw-r--r--src/fs/fs_unindex.c4
-rw-r--r--src/fs/fs_uri.c1
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c23
-rw-r--r--src/peerinfo/peerinfo_api.c3
-rw-r--r--src/transport/gnunet-service-transport.c3
-rw-r--r--src/transport/plugin_transport_tcp.c1
-rw-r--r--src/util/configuration.c2
-rw-r--r--src/util/crypto_hash.c12
-rw-r--r--src/util/crypto_rsa.c5
-rw-r--r--src/util/disk.c1
-rw-r--r--src/util/getopt_helpers.c9
-rw-r--r--src/util/os_installation.c2
-rw-r--r--src/util/os_network.c4
-rw-r--r--src/util/test_crypto_aes_weak.c1
-rw-r--r--src/util/test_os_load.c2
-rw-r--r--src/util/test_scheduler.c13
22 files changed, 57 insertions, 62 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c
index ac958449b..6aca88640 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -272,11 +272,9 @@ static void
272timeout_request (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 272timeout_request (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
273{ 273{
274 struct GNUNET_CORE_TransmitHandle *th = cls; 274 struct GNUNET_CORE_TransmitHandle *th = cls;
275 struct GNUNET_CORE_Handle *h;
276 275
277 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 276 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
278 "Transmission request timed out.\n"); 277 "Transmission request timed out.\n");
279 h = th->ch;
280 th->timeout_task = GNUNET_SCHEDULER_NO_TASK; 278 th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
281 GNUNET_assert (0 == th->get_message (th->get_message_cls, 0, NULL)); 279 GNUNET_assert (0 == th->get_message (th->get_message_cls, 0, NULL));
282 GNUNET_CORE_notify_transmit_ready_cancel (th); 280 GNUNET_CORE_notify_transmit_ready_cancel (th);
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 4012ac3a8..d950237cd 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -2918,7 +2918,6 @@ neighbour_quota_update (void *cls,
2918 account for possibility of new neighbours joining any time 2918 account for possibility of new neighbours joining any time
2919 AND to convert to double... */ 2919 AND to convert to double... */
2920 pref_rel = n->current_preference / (1.0 + preference_sum); 2920 pref_rel = n->current_preference / (1.0 + preference_sum);
2921 share = 0;
2922 distributable = 0; 2921 distributable = 0;
2923 if (bandwidth_target_out > neighbour_count * MIN_BPM_PER_PEER) 2922 if (bandwidth_target_out > neighbour_count * MIN_BPM_PER_PEER)
2924 distributable = bandwidth_target_out - neighbour_count * MIN_BPM_PER_PEER; 2923 distributable = bandwidth_target_out - neighbour_count * MIN_BPM_PER_PEER;
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index 87ae427e4..900c1a8c8 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -748,7 +748,6 @@ handle_release_reserve (void *cls,
748 return; 748 return;
749 } 749 }
750 prev = pos; 750 prev = pos;
751 pos = next;
752 } 751 }
753 GNUNET_break (0); 752 GNUNET_break (0);
754 transmit_status (client, GNUNET_SYSERR, gettext_noop ("Could not find matching reservation")); 753 transmit_status (client, GNUNET_SYSERR, gettext_noop ("Could not find matching reservation"));
diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c
index d67c6e8ef..fa046b858 100644
--- a/src/fs/fs_directory.c
+++ b/src/fs/fs_directory.c
@@ -335,7 +335,8 @@ GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
335 fsize = 0; /* not given */ 335 fsize = 0; /* not given */
336 if (fsize > MAX_INLINE_SIZE) 336 if (fsize > MAX_INLINE_SIZE)
337 fsize = 0; /* too large */ 337 fsize = 0; /* too large */
338 if (NULL != memchr (data, 0, fsize)) 338 if ( (NULL == data) ||
339 (NULL != memchr (data, 0, fsize)) )
339 fsize = 0; /* must not have 0's in data! */ 340 fsize = 0; /* must not have 0's in data! */
340 uris = GNUNET_FS_uri_to_string (uri); 341 uris = GNUNET_FS_uri_to_string (uri);
341 slen = strlen (uris) + 1; 342 slen = strlen (uris) + 1;
@@ -524,12 +525,11 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
524 sizes[i] = pos->len; 525 sizes[i] = pos->len;
525 pos = pos->next; 526 pos = pos->next;
526 } 527 }
528 block_align (size,
529 bld->count,
530 sizes,
531 perm);
527 } 532 }
528 block_align (size,
529 bld->count,
530 sizes,
531 perm);
532
533 /* compute final size with alignment */ 533 /* compute final size with alignment */
534 for (i = 0; i < bld->count; i++) 534 for (i = 0; i < bld->count; i++)
535 { 535 {
@@ -563,9 +563,12 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
563 sizes[i]); 563 sizes[i]);
564 GNUNET_free (bes[i]); 564 GNUNET_free (bes[i]);
565 } 565 }
566 GNUNET_free (sizes); 566 if (bld->count > 0)
567 GNUNET_free (perm); 567 {
568 GNUNET_free (bes); 568 GNUNET_free (sizes);
569 GNUNET_free (perm);
570 GNUNET_free (bes);
571 }
569 GNUNET_assert (off == size); 572 GNUNET_assert (off == size);
570 GNUNET_CONTAINER_meta_data_destroy (bld->meta); 573 GNUNET_CONTAINER_meta_data_destroy (bld->meta);
571 GNUNET_free (bld); 574 GNUNET_free (bld);
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 77fbb1139..9ab4c5ce0 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -669,8 +669,8 @@ GNUNET_FS_file_download_start (struct GNUNET_FS_Handle *h,
669 return NULL; 669 return NULL;
670 // FIXME: add support for "loc" URIs! 670 // FIXME: add support for "loc" URIs!
671 GNUNET_assert (GNUNET_FS_uri_test_chk (uri)); 671 GNUNET_assert (GNUNET_FS_uri_test_chk (uri));
672 if ( (dc->offset + dc->length < dc->offset) || 672 if ( (offset + length < offset) ||
673 (dc->offset + dc->length > uri->data.chk.file_length) ) 673 (offset + length > uri->data.chk.file_length) )
674 { 674 {
675 GNUNET_break (0); 675 GNUNET_break (0);
676 return NULL; 676 return NULL;
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index fd7dcf6d9..1a9fc699e 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -766,9 +766,9 @@ search_start (struct GNUNET_FS_Handle *h,
766 _("Too many keywords specified for a single search.")); 766 _("Too many keywords specified for a single search."));
767 return NULL; 767 return NULL;
768 } 768 }
769 client = GNUNET_CLIENT_connect (sc->h->sched, 769 client = GNUNET_CLIENT_connect (h->sched,
770 "fs", 770 "fs",
771 sc->h->cfg); 771 h->cfg);
772 if (NULL == client) 772 if (NULL == client)
773 return NULL; 773 return NULL;
774 sc = GNUNET_malloc (sizeof(struct GNUNET_FS_SearchContext)); 774 sc = GNUNET_malloc (sizeof(struct GNUNET_FS_SearchContext));
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index 03dae383f..977344b98 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -223,8 +223,8 @@ unindex_process (void *cls,
223 } 223 }
224 GNUNET_DATASTORE_remove (uc->dsh, 224 GNUNET_DATASTORE_remove (uc->dsh,
225 query, 225 query,
226 block_size, 226 size,
227 block, 227 data,
228 &process_cont, 228 &process_cont,
229 uc, 229 uc,
230 GNUNET_CONSTANTS_SERVICE_TIMEOUT); 230 GNUNET_CONSTANTS_SERVICE_TIMEOUT);
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index 61fb7d61d..4f4a82c2c 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -492,7 +492,6 @@ enc2bin (const char *input, void *data, size_t size)
492 bits = 0; 492 bits = 0;
493 hbits = 0; 493 hbits = 0;
494 len = 0; 494 len = 0;
495 pos = 0;
496 for (pos = 0; pos < size; pos++) 495 for (pos = 0; pos < size; pos++)
497 { 496 {
498 while (hbits < 8) 497 while (hbits < 8)
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index 3a6030fda..281779897 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -206,11 +206,24 @@ add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity)
206 { 206 {
207 size = GNUNET_DISK_fn_read (fn, buffer, sizeof (buffer)); 207 size = GNUNET_DISK_fn_read (fn, buffer, sizeof (buffer));
208 hello = (const struct GNUNET_HELLO_Message *) buffer; 208 hello = (const struct GNUNET_HELLO_Message *) buffer;
209 now = GNUNET_TIME_absolute_get (); 209 if ( (size < sizeof (struct GNUNET_MessageHeader)) ||
210 hello_clean = GNUNET_HELLO_iterate_addresses (hello, 210 (size != ntohs((((const struct GNUNET_MessageHeader*) hello)->size))) ||
211 GNUNET_YES, 211 (size != GNUNET_HELLO_size (hello)) )
212 &discard_expired, &now); 212 {
213 entry->hello = hello_clean; 213 GNUNET_break (0);
214 if (0 != UNLINK (fn))
215 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
216 "unlink",
217 fn);
218 }
219 else
220 {
221 now = GNUNET_TIME_absolute_get ();
222 hello_clean = GNUNET_HELLO_iterate_addresses (hello,
223 GNUNET_YES,
224 &discard_expired, &now);
225 entry->hello = hello_clean;
226 }
214 } 227 }
215 GNUNET_free (fn); 228 GNUNET_free (fn);
216 entry->next = hosts; 229 entry->next = hosts;
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 28865edc6..57197798b 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -262,8 +262,8 @@ GNUNET_PEERINFO_for_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
262 struct GNUNET_CLIENT_Connection *client; 262 struct GNUNET_CLIENT_Connection *client;
263 struct ListAllPeersMessage *lapm; 263 struct ListAllPeersMessage *lapm;
264 struct ListPeerMessage *lpm; 264 struct ListPeerMessage *lpm;
265 size_t hs;
266 struct InfoContext *ihc; 265 struct InfoContext *ihc;
266 size_t hs;
267 267
268 client = GNUNET_CLIENT_connect (sched, "peerinfo", cfg); 268 client = GNUNET_CLIENT_connect (sched, "peerinfo", cfg);
269 if (client == NULL) 269 if (client == NULL)
@@ -279,7 +279,6 @@ GNUNET_PEERINFO_for_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
279 ihc->callback = callback; 279 ihc->callback = callback;
280 ihc->callback_cls = callback_cls; 280 ihc->callback_cls = callback_cls;
281 ihc->timeout = GNUNET_TIME_relative_to_absolute (timeout); 281 ihc->timeout = GNUNET_TIME_relative_to_absolute (timeout);
282 hs = 0;
283 if (peer == NULL) 282 if (peer == NULL)
284 { 283 {
285 lapm = (struct ListAllPeersMessage *) &ihc[1]; 284 lapm = (struct ListAllPeersMessage *) &ihc[1];
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 3e696827f..09f87d444 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -2178,7 +2178,8 @@ plugin_env_receive (void *cls,
2178 } 2178 }
2179 GNUNET_free (im); 2179 GNUNET_free (im);
2180 } 2180 }
2181 GNUNET_assert (NULL != service_context->neighbour); 2181 GNUNET_assert ( (service_context == NULL) ||
2182 (NULL != service_context->neighbour) );
2182 return service_context; 2183 return service_context;
2183} 2184}
2184 2185
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 17570254b..bfa17d275 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -1340,7 +1340,6 @@ update_quota (struct Session *session, int force)
1340 else 1340 else
1341 { 1341 {
1342 /* got more than acceptable */ 1342 /* got more than acceptable */
1343 total_remaining = 0;
1344 session->last_received -= total_allowed; 1343 session->last_received -= total_allowed;
1345 delta = 0; 1344 delta = 0;
1346 } 1345 }
diff --git a/src/util/configuration.c b/src/util/configuration.c
index 0ce672dd9..8c32618e2 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -807,13 +807,11 @@ GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle
807 char *end; 807 char *end;
808 char *match; 808 char *match;
809 char old; 809 char old;
810 int ret;
811 810
812 if (GNUNET_OK != 811 if (GNUNET_OK !=
813 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &list)) 812 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &list))
814 return GNUNET_NO; 813 return GNUNET_NO;
815 match = escape_name (value); 814 match = escape_name (value);
816 ret = 0;
817 pos = list; 815 pos = list;
818 while (1) 816 while (1)
819 { 817 {
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 45e599bcf..bc15113c6 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -214,10 +214,6 @@ sha512_transform (unsigned long long *state, const unsigned char *input)
214 state[5] += f; 214 state[5] += f;
215 state[6] += g; 215 state[6] += g;
216 state[7] += h; 216 state[7] += h;
217
218 /* erase our data */
219 a = b = c = d = e = f = g = h = t1 = t2 = 0;
220 memset (W, 0, 80 * sizeof (unsigned long long));
221} 217}
222 218
223static void 219static void
@@ -281,13 +277,13 @@ sha512_final (struct sha512_ctx *sctx, unsigned char *hash)
281 static unsigned char padding[128] = { 0x80, }; 277 static unsigned char padding[128] = { 0x80, };
282 278
283 unsigned int t; 279 unsigned int t;
284 unsigned long long t2;
285 unsigned char bits[128]; 280 unsigned char bits[128];
286 unsigned int index, pad_len; 281 unsigned int index;
282 unsigned int pad_len;
283 unsigned long long t2;
287 int i, j; 284 int i, j;
288 285
289 index = pad_len = t = i = j = 0; 286 t = i = j = 0;
290 t2 = 0;
291 287
292 /* Save number of bits */ 288 /* Save number of bits */
293 t = sctx->count[0]; 289 t = sctx->count[0];
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c
index f686c0359..edf1b2bdf 100644
--- a/src/util/crypto_rsa.c
+++ b/src/util/crypto_rsa.c
@@ -602,7 +602,7 @@ GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename)
602 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 602 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
603 _ 603 _
604 ("Could not aquire lock on file `%s' due to process %u: %s...\n"), 604 ("Could not aquire lock on file `%s' due to process %u: %s...\n"),
605 filename, fl.l_pid, STRERROR (errno)); 605 filename, fl.l_pid, STRERROR (ec));
606 } 606 }
607 memset (&fl, 0, sizeof (struct flock)); 607 memset (&fl, 0, sizeof (struct flock));
608 fl.l_type = F_WRLCK; 608 fl.l_type = F_WRLCK;
@@ -624,7 +624,6 @@ GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename)
624 fl.l_type = F_UNLCK; 624 fl.l_type = F_UNLCK;
625 fl.l_whence = SEEK_SET; 625 fl.l_whence = SEEK_SET;
626 fl.l_len = sizeof (struct RsaPrivateKeyBinaryEncoded); 626 fl.l_len = sizeof (struct RsaPrivateKeyBinaryEncoded);
627 cnt = 0;
628 if (0 != fcntl (fd, F_SETLK, &fl)) 627 if (0 != fcntl (fd, F_SETLK, &fl))
629 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, 628 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
630 "fcntl", filename); 629 "fcntl", filename);
@@ -659,7 +658,7 @@ GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename)
659 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 658 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
660 _ 659 _
661 ("Could not aquire lock on file `%s' due to process %u: %s...\n"), 660 ("Could not aquire lock on file `%s' due to process %u: %s...\n"),
662 filename, fl.l_pid, STRERROR (errno)); 661 filename, fl.l_pid, STRERROR (ec));
663 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 662 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
664 _ 663 _
665 ("This may be ok if someone is currently generating a hostkey.\n")); 664 ("This may be ok if someone is currently generating a hostkey.\n"));
diff --git a/src/util/disk.c b/src/util/disk.c
index 3f46923f7..f6a4e7b90 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1038,7 +1038,6 @@ GNUNET_DISK_file_open (const char *fn, int flags, ...)
1038 1038
1039#ifndef MINGW 1039#ifndef MINGW
1040 mode = 0; 1040 mode = 0;
1041 oflags = 0;
1042 if (GNUNET_DISK_OPEN_READWRITE == (flags & GNUNET_DISK_OPEN_READWRITE)) 1041 if (GNUNET_DISK_OPEN_READWRITE == (flags & GNUNET_DISK_OPEN_READWRITE))
1043 oflags = O_RDWR; /* note: O_RDWR is NOT always O_RDONLY | O_WRONLY */ 1042 oflags = O_RDWR; /* note: O_RDWR is NOT always O_RDONLY | O_WRONLY */
1044 else if (flags & GNUNET_DISK_OPEN_READ) 1043 else if (flags & GNUNET_DISK_OPEN_READ)
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c
index 3aea5d102..a8a800a00 100644
--- a/src/util/getopt_helpers.c
+++ b/src/util/getopt_helpers.c
@@ -50,11 +50,11 @@ GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
50 const char *value) 50 const char *value)
51{ 51{
52 const char *about = scls; 52 const char *about = scls;
53 int slen; 53 size_t slen;
54 int i; 54 unsigned int i;
55 int j; 55 int j;
56 int ml; 56 size_t ml;
57 int p; 57 size_t p;
58 char *scp; 58 char *scp;
59 const char *trans; 59 const char *trans;
60 const struct GNUNET_GETOPT_CommandLineOption *opt; 60 const struct GNUNET_GETOPT_CommandLineOption *opt;
@@ -62,7 +62,6 @@ GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
62 printf ("%s\n%s\n", ctx->binaryOptions, gettext (about)); 62 printf ("%s\n%s\n", ctx->binaryOptions, gettext (about));
63 printf (_ 63 printf (_
64 ("Arguments mandatory for long options are also mandatory for short options.\n")); 64 ("Arguments mandatory for long options are also mandatory for short options.\n"));
65 slen = 0;
66 i = 0; 65 i = 0;
67 opt = ctx->allOptions; 66 opt = ctx->allOptions;
68 while (opt[i].description != NULL) 67 while (opt[i].description != NULL)
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index cc1d61c20..39b5174e3 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -213,14 +213,12 @@ get_path_from_PATH ()
213 char *end; 213 char *end;
214 char *buf; 214 char *buf;
215 const char *p; 215 const char *p;
216 size_t size;
217 216
218 p = getenv ("PATH"); 217 p = getenv ("PATH");
219 if (p == NULL) 218 if (p == NULL)
220 return NULL; 219 return NULL;
221 path = GNUNET_strdup (p); /* because we write on it */ 220 path = GNUNET_strdup (p); /* because we write on it */
222 buf = GNUNET_malloc (strlen (path) + 20); 221 buf = GNUNET_malloc (strlen (path) + 20);
223 size = strlen (path);
224 pos = path; 222 pos = path;
225 223
226 while (NULL != (end = strchr (pos, ':'))) 224 while (NULL != (end = strchr (pos, ':')))
diff --git a/src/util/os_network.c b/src/util/os_network.c
index 4268772df..c872350c5 100644
--- a/src/util/os_network.c
+++ b/src/util/os_network.c
@@ -163,13 +163,11 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
163#elif HAVE_GETIFADDRS && HAVE_FREEIFADDRS 163#elif HAVE_GETIFADDRS && HAVE_FREEIFADDRS
164 164
165 struct ifaddrs *ifa_first; 165 struct ifaddrs *ifa_first;
166 struct ifaddrs *ifa_ptr;
166 socklen_t alen; 167 socklen_t alen;
167 168
168 if (getifaddrs (&ifa_first) == 0) 169 if (getifaddrs (&ifa_first) == 0)
169 { 170 {
170 struct ifaddrs *ifa_ptr;
171
172 ifa_ptr = ifa_first;
173 for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next) 171 for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next)
174 { 172 {
175 if (ifa_ptr->ifa_name != NULL && 173 if (ifa_ptr->ifa_name != NULL &&
diff --git a/src/util/test_crypto_aes_weak.c b/src/util/test_crypto_aes_weak.c
index 2ce553a21..a694b6481 100644
--- a/src/util/test_crypto_aes_weak.c
+++ b/src/util/test_crypto_aes_weak.c
@@ -145,7 +145,6 @@ getWeakKeys ()
145 { 145 {
146 printf ("testweakkey: gcry_cipher_open failed on trial %d. %s\n", 146 printf ("testweakkey: gcry_cipher_open failed on trial %d. %s\n",
147 number_of_runs, gcry_strerror (rc)); 147 number_of_runs, gcry_strerror (rc));
148 rc = 0;
149 continue; 148 continue;
150 } 149 }
151 150
diff --git a/src/util/test_os_load.c b/src/util/test_os_load.c
index b46a3eb59..7165e7ef2 100644
--- a/src/util/test_os_load.c
+++ b/src/util/test_os_load.c
@@ -165,7 +165,7 @@ testdisk ()
165 } 165 }
166 fprintf (stderr, "\n"); 166 fprintf (stderr, "\n");
167 GNUNET_CONFIGURATION_destroy (cfg); 167 GNUNET_CONFIGURATION_destroy (cfg);
168 return 0; 168 return ret;
169} 169}
170 170
171int 171int
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c
index 0d5af1c0c..811389953 100644
--- a/src/util/test_scheduler.c
+++ b/src/util/test_scheduler.c
@@ -138,7 +138,6 @@ task1 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
138{ 138{
139 int *ok = cls; 139 int *ok = cls;
140 GNUNET_SCHEDULER_TaskIdentifier t2; 140 GNUNET_SCHEDULER_TaskIdentifier t2;
141 GNUNET_SCHEDULER_TaskIdentifier t3;
142 GNUNET_SCHEDULER_TaskIdentifier t4; 141 GNUNET_SCHEDULER_TaskIdentifier t4;
143 142
144 GNUNET_assert (1 == *ok); 143 GNUNET_assert (1 == *ok);
@@ -154,12 +153,12 @@ task1 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
154 GNUNET_NO, 153 GNUNET_NO,
155 GNUNET_SCHEDULER_PRIORITY_IDLE, 154 GNUNET_SCHEDULER_PRIORITY_IDLE,
156 t2, &task4, cls); 155 t2, &task4, cls);
157 t3 = GNUNET_SCHEDULER_add_delayed (tc->sched, 156 GNUNET_SCHEDULER_add_delayed (tc->sched,
158 GNUNET_NO, 157 GNUNET_NO,
159 GNUNET_SCHEDULER_PRIORITY_DEFAULT, 158 GNUNET_SCHEDULER_PRIORITY_DEFAULT,
160 t2, 159 t2,
161 GNUNET_TIME_relative_get_zero (), 160 GNUNET_TIME_relative_get_zero (),
162 &task3, cls); 161 &task3, cls);
163 /* t4 will go first: lower prio, but prereq! */ 162 /* t4 will go first: lower prio, but prereq! */
164 GNUNET_SCHEDULER_add_after (tc->sched, 163 GNUNET_SCHEDULER_add_after (tc->sched,
165 GNUNET_NO, 164 GNUNET_NO,