From: Roger Dingledine Date: Sat, 20 Mar 2004 20:37:49 +0000 (+0000) Subject: make OR not crash when non-OR connection dies X-Git-Tag: tor-0.0.3~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed0ef86c0ee71475ffceb3aef32d60a886e7e436;p=thirdparty%2Ftor.git make OR not crash when non-OR connection dies svn:r1319 --- diff --git a/src/or/rephist.c b/src/or/rephist.c index ab03fab09b..998758164e 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -131,6 +131,14 @@ void rep_hist_note_disconnect(const char* nickname, time_t when) void rep_hist_note_connection_died(const char* nickname, time_t when) { or_history_t *hist; + if(!nickname) { + /* XXX + * If conn has no nickname, it's either an OP, or it is an OR + * which didn't complete its handshake (or did and was unapproved). + * Ignore it. Is there anything better we could do? + */ + return; + } hist = get_or_history(nickname); if (hist->up_since) { hist->uptime += (when - hist->up_since);