]> git.ipfire.org Git - thirdparty/tor.git/commit
state: Fix segfault on malformed file
authorDavid Goulet <dgoulet@torproject.org>
Tue, 10 Jan 2023 14:24:09 +0000 (09:24 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 10 Jan 2023 14:25:50 +0000 (09:25 -0500)
commit4db610d6d96f711d3bd1e8f2a0080d83f1f5fcd0
tree4113c329b4efd558146a63ceda7ae5f079eefa1a
parent7e055c383c1204847dcf842ed39fea0e8d8d92d8
state: Fix segfault on malformed file

Having no TotalBuildTimes along a positive CircuitBuildAbandonedCount
count lead to a segfault. We check for that condition and then BUG + log
warn if that is the case.

It should never happened in theory but if someone modified their state
file, it can lead to this problem so instead of segfaulting, warn.

Fixes #40437

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40437 [new file with mode: 0644]
src/core/or/circuitstats.c