diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-09-01 09:52:46 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-09-01 09:52:46 -0400 |
commit | f4ded2cdc98f46817c381fc633e3161d52f75242 (patch) | |
tree | 158c206b999eaf5b0b8c7476ced705f951ccd16c /src/or/dirserv.c | |
parent | b977a570c4fea136910fb9f41fd57b9ba3e34699 (diff) | |
download | tor-f4ded2cdc98f46817c381fc633e3161d52f75242.tar.gz tor-f4ded2cdc98f46817c381fc633e3161d52f75242.zip |
Fix an always-false check with an assertion
In validate_recommended_package_line, at this point in the function,
n_entries is always >= 1. Coverity doesn't like us checking it for
0.
CID 1268063.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 58ab009cbf..2e5766aa14 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -3745,7 +3745,9 @@ validate_recommended_package_line(const char *line) cp = end_of_word + 1; } - return (n_entries == 0) ? 0 : 1; + /* If we reach this point, we have at least 1 entry. */ + tor_assert(n_entries > 0) + return 1; } /** Release all storage used by the directory server. */ |