In routerlist_assert_ok(), check r2 before taking &(r2->cache_info)
commit3c2c6a61163cd6a42cc0eeee9fc43200b9f08503
authorNick Mathewson <nickm@torproject.org>
Thu, 11 Sep 2014 03:46:20 +0000 (10 23:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 11 Sep 2014 03:48:11 +0000 (10 23:48 -0400)
tree94a717f1d8d0caaf3791c20e600835e0b85588bc
parenta9b2e5eac6168a1eb09da8d6d3ff43b08cc51411
In routerlist_assert_ok(), check r2 before taking &(r2->cache_info)

Technically, we're not allowed to take the address of a member can't
exist relative to the null pointer.  That makes me wonder how any sane
compliant system implements the offsetof macro, but let's let sleeping
balrogs lie.

Fixes 13096; patch on 0.1.1.9-alpha; patch from "teor", who was using
clang -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error -ftrapv
changes/bug13096 [new file with mode: 0644]
src/or/routerlist.c