summaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-05-15 11:25:52 -0400
committerNick Mathewson <nickm@torproject.org>2017-05-15 11:27:12 -0400
commit0e348720fc3a4db0e61fcb81673080ae71e80b4e (patch)
tree65230a12e36b37ec5dba03772ab90bed276f4c24 /src/or/dns.c
parent1ec45bb54621208906ce260255086a8456a9646e (diff)
downloadtor-0e348720fc3a4db0e61fcb81673080ae71e80b4e.tar.gz
tor-0e348720fc3a4db0e61fcb81673080ae71e80b4e.zip
Fix assertion to actually have a chance of failing
This assertion can only fail if we mess up some of our other code, but let's try to get it right. Closes 22244.
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index cd84a64758..024a21abfe 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -160,8 +160,9 @@ evdns_log_cb(int warn, const char *msg)
}
if (!strcmpstart(msg, "Nameserver ") && (cp=strstr(msg, " has failed: "))) {
char *ns = tor_strndup(msg+11, cp-(msg+11));
- const char *err = strchr(cp, ':')+2;
- tor_assert(err);
+ const char *colon = strchr(cp, ':');
+ tor_assert(colon);
+ const char *err = colon+2;
/* Don't warn about a single failed nameserver; we'll warn with 'all
* nameservers have failed' if we're completely out of nameservers;
* otherwise, the situation is tolerable. */