[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r8308: Apply patch from Adam Langley: fix assert() in eventdns.c. [ (in tor/trunk: . src/or)



Author: nickm
Date: 2006-08-30 19:34:56 -0400 (Wed, 30 Aug 2006)
New Revision: 8308

Modified:
   tor/trunk/
   tor/trunk/src/or/eventdns.c
Log:
 r8687@Kushana:  nickm | 2006-08-30 19:33:28 -0400
 Apply patch from Adam Langley: fix assert() in eventdns.c.  [Fuzzing, apparently, is cool.]



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r8687] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/or/eventdns.c
===================================================================
--- tor/trunk/src/or/eventdns.c	2006-08-30 23:34:49 UTC (rev 8307)
+++ tor/trunk/src/or/eventdns.c	2006-08-30 23:34:56 UTC (rev 8308)
@@ -528,8 +528,13 @@
 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)];