tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 34a2cbb249cdaf23c88b93972a9216926a8d7551
parent a52d5d530956d2b2acf28400d1635b2fd1320f96
Author: George Kadianakis <desnacked@riseup.net>
Date:   Mon, 10 Sep 2018 16:47:28 +0300

Address coverity warnings (CID 1439133/1439132).

>>>>    CID 1439133:  Null pointer dereferences  (REVERSE_INULL)
>>>>    Null-checking "fields" suggests that it may be null, but it
>>>> has already been dereferenced on all paths leading to the check.

>>>>    CID 1439132:  Null pointer dereferences  (REVERSE_INULL)
>>>>    Null-checking "fields" suggests that it may be null, but it
>>>> has already been dereferenced on all paths leading to the check.

Diffstat:
Msrc/feature/hs/hs_client.c | 7+++----
Msrc/feature/hs/hs_service.c | 7+++----
2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c @@ -1524,10 +1524,9 @@ parse_auth_file_content(const char *client_key_str) if (seckey_b32) { memwipe(seckey_b32, 0, strlen(seckey_b32)); } - if (fields) { - SMARTLIST_FOREACH(fields, char *, s, tor_free(s)); - smartlist_free(fields); - } + tor_assert(fields); + SMARTLIST_FOREACH(fields, char *, s, tor_free(s)); + smartlist_free(fields); return auth; } diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c @@ -1192,10 +1192,9 @@ parse_authorized_client(const char *client_key_str) if (pubkey_b32) { memwipe(pubkey_b32, 0, strlen(pubkey_b32)); } - if (fields) { - SMARTLIST_FOREACH(fields, char *, s, tor_free(s)); - smartlist_free(fields); - } + tor_assert(fields); + SMARTLIST_FOREACH(fields, char *, s, tor_free(s)); + smartlist_free(fields); return client; }