mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Add a couple of sanity-checks for return values that coverity thinks we ought to have. CIDs 337, 335.
svn:r17485
This commit is contained in:
parent
2be5215181
commit
e06442b648
@ -2552,6 +2552,7 @@ networkstatus_parse_detached_signatures(const char *s, const char *eos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tok = find_first_by_keyword(tokens, K_CONSENSUS_DIGEST);
|
tok = find_first_by_keyword(tokens, K_CONSENSUS_DIGEST);
|
||||||
|
tor_assert(tok);
|
||||||
if (strlen(tok->args[0]) != HEX_DIGEST_LEN) {
|
if (strlen(tok->args[0]) != HEX_DIGEST_LEN) {
|
||||||
log_warn(LD_DIR, "Wrong length on consensus-digest in detached "
|
log_warn(LD_DIR, "Wrong length on consensus-digest in detached "
|
||||||
"networkstatus signatures");
|
"networkstatus signatures");
|
||||||
|
@ -763,6 +763,7 @@ test_crypto(void)
|
|||||||
memset(data1, 6, 1024);
|
memset(data1, 6, 1024);
|
||||||
for (idx = 0; idx < 10; ++idx) {
|
for (idx = 0; idx < 10; ++idx) {
|
||||||
i = base64_encode(data2, 1024, data1, idx);
|
i = base64_encode(data2, 1024, data1, idx);
|
||||||
|
test_assert(i >= 0);
|
||||||
j = base64_decode(data3, 1024, data2, i);
|
j = base64_decode(data3, 1024, data2, i);
|
||||||
test_eq(j,idx);
|
test_eq(j,idx);
|
||||||
test_memeq(data3, data1, idx);
|
test_memeq(data3, data1, idx);
|
||||||
|
Loading…
Reference in New Issue
Block a user