This bug can crash on OSs where int t = 0; r = tor_gmtime_r(&t, ...); returns NULL, or a non-NULL r with r->tm_year outside the range -1899 to 8099. This has only been detected as a bug by our unit tests on Windows so far.
Once this case is triggered, if an int of uninitialised stack memory happens to be outside 0-6, tor crashes.
It's only triggered by code paths that set if_modified_since in directory_send_command() to 0, and most code paths on relays and clients set if_modified_since to 0. (It might also be possible for authorities to trigger this crash by passing a directory server a cached-but-not-validated consensus that has a bad time value, but I have yet to confirm this.)
There are many clients but few relays on Windows.
Given the simplicity of this patch, and the fact that a failure causes a crash, I suggest we backport it to 0.2.4 (the latest running version on the network) onwards.
bug18977_024 now has a fixup commit, but I don't know if I got the case you meant. If I didn't, please let me know where it is?
[...]
Given the simplicity of this patch, and the fact that a failure causes a crash, I suggest we backport it to 0.2.4 (the latest running version on the network) onwards.
Okay. Let's try on 0.2.7+, and backport ad libitum.