aboutsummaryrefslogtreecommitdiff
path: root/src/or/eventdns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-08-30 23:34:56 +0000
committerNick Mathewson <nickm@torproject.org>2006-08-30 23:34:56 +0000
commit921bfdb40a032720a04d1623b210a28994ee5c14 (patch)
tree646a8ff1369e6c57791183cdf109a22c46948d1c /src/or/eventdns.c
parent6c499804bb308f941064842840490afd9ffcc386 (diff)
downloadtor-921bfdb40a032720a04d1623b210a28994ee5c14.tar
tor-921bfdb40a032720a04d1623b210a28994ee5c14.tar.gz
r8687@Kushana: nickm | 2006-08-30 19:33:28 -0400
Apply patch from Adam Langley: fix assert() in eventdns.c. [Fuzzing, apparently, is cool.] svn:r8308
Diffstat (limited to 'src/or/eventdns.c')
-rw-r--r--src/or/eventdns.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index f0c99f7f0..31c569af1 100644
--- a/src/or/eventdns.c
+++ b/src/or/eventdns.c
@@ -528,8 +528,13 @@ nameserver_prod_callback(int fd, short events, void *arg) {
static void
nameserver_probe_failed(struct nameserver *const ns) {
const struct timeval * timeout;
- assert(ns->state == 0);
(void) evtimer_del(&ns->timeout_event);
+ if (ns->state == 1) {
+ // This can happen if the nameserver acts in a way which makes us mark
+ // it as bad and then starts sending good replies.
+ return;
+ }
+
timeout =
&global_nameserver_timeouts[MIN(ns->failed_times,
global_nameserver_timeouts_length - 1)];