diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-08-30 23:34:56 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-08-30 23:34:56 +0000 |
commit | 921bfdb40a032720a04d1623b210a28994ee5c14 (patch) | |
tree | 646a8ff1369e6c57791183cdf109a22c46948d1c | |
parent | 6c499804bb308f941064842840490afd9ffcc386 (diff) | |
download | tor-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
-rw-r--r-- | src/or/eventdns.c | 7 |
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)]; |