aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-02-09 11:46:06 +0000
committerNathan S. Evans <evans@in.tum.de>2011-02-09 11:46:06 +0000
commitfa4c37b7bf11220ff5984b9fe9004aa979b6196b (patch)
tree49eb1fa1a9fdf0307e8dc5e3edc1c0213c660e9f /src/util
parentd5ec3efa8842398cb3e1e9812b53abd1966e65fb (diff)
downloadgnunet-fa4c37b7bf11220ff5984b9fe9004aa979b6196b.tar.gz
gnunet-fa4c37b7bf11220ff5984b9fe9004aa979b6196b.zip
assert fd's are in valid range
Diffstat (limited to 'src/util')
-rw-r--r--src/util/scheduler.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 9021a324a..025c591e8 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -1219,6 +1219,7 @@ add_without_sets (struct GNUNET_TIME_Relative delay,
1219 t->backtrace_strings = backtrace_symbols(backtrace_array, t->num_backtrace_strings); 1219 t->backtrace_strings = backtrace_symbols(backtrace_array, t->num_backtrace_strings);
1220#endif 1220#endif
1221 t->read_fd = rfd; 1221 t->read_fd = rfd;
1222 GNUNET_assert(wfd >= -1);
1222 t->write_fd = wfd; 1223 t->write_fd = wfd;
1223 t->id = ++last_id; 1224 t->id = ++last_id;
1224#if PROFILE_DELAYS 1225#if PROFILE_DELAYS
@@ -1328,6 +1329,7 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
1328 GNUNET_NETWORK_fdset_destroy (ws); 1329 GNUNET_NETWORK_fdset_destroy (ws);
1329 return ret; 1330 return ret;
1330#else 1331#else
1332 GNUNET_assert(GNUNET_NETWORK_get_fd(wfd) >= 0);
1331 return add_without_sets (delay, 1333 return add_without_sets (delay,
1332 -1, 1334 -1,
1333 GNUNET_NETWORK_get_fd (wfd), 1335 GNUNET_NETWORK_get_fd (wfd),
@@ -1421,6 +1423,7 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
1421 int fd; 1423 int fd;
1422 1424
1423 GNUNET_DISK_internal_file_handle_ (wfd, &fd, sizeof (int)); 1425 GNUNET_DISK_internal_file_handle_ (wfd, &fd, sizeof (int));
1426 GNUNET_assert(fd >= 0);
1424 return add_without_sets (delay, 1427 return add_without_sets (delay,
1425 -1, 1428 -1,
1426 fd, 1429 fd,