From: Nick Mathewson Date: Mon, 13 Feb 2012 00:42:35 +0000 (-0500) Subject: Unpack a smartlist_foreach and add an assert: try to hunt #5102 X-Git-Tag: tor-0.2.3.12-alpha~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61452299d1067298a2865deb6398b1fb269b2a81;p=thirdparty%2Ftor.git Unpack a smartlist_foreach and add an assert: try to hunt #5102 --- diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 07598e242f..7c404e63cb 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -3906,14 +3906,14 @@ entry_guard_register_connect_status(const char *digest, int succeeded, if (! entry_guards) return 0; - SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e, - { - if (tor_memeq(e->identity, digest, DIGEST_LEN)) { - entry = e; - idx = e_sl_idx; - break; - } - }); + SMARTLIST_FOREACH_BEGIN(entry_guards, entry_guard_t *, e) { + tor_assert(e); + if (tor_memeq(e->identity, digest, DIGEST_LEN)) { + entry = e; + idx = e_sl_idx; + break; + } + } SMARTLIST_FOREACH_END(e); if (!entry) return 0;