diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-25 01:24:39 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-25 01:24:39 -0400 |
commit | d3c05a79f0b3e688e43edfffe9886664777517f7 (patch) | |
tree | caf18aa657f83c5bf224bd2750dc5e81d2000e3d /src/test | |
parent | 12b1d64b0378450fb8c69dfe81fde2d1cd1b36b1 (diff) | |
parent | 5470795b834a788ec482f22091d58b27a1999a2d (diff) | |
download | tor-d3c05a79f0b3e688e43edfffe9886664777517f7.tar.gz tor-d3c05a79f0b3e688e43edfffe9886664777517f7.zip |
Merge branch 'scanbuild_fixes'
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_addr.c | 3 | ||||
-rw-r--r-- | src/test/test_oom.c | 4 | ||||
-rw-r--r-- | src/test/test_policy.c | 6 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/test/test_addr.c b/src/test/test_addr.c index cee2dcf2a0..50011e606b 100644 --- a/src/test/test_addr.c +++ b/src/test/test_addr.c @@ -346,6 +346,9 @@ test_addr_ip6_helpers(void) test_pton6_bad("a:::b:c"); test_pton6_bad(":::a:b:c"); test_pton6_bad("a:b:c:::"); + test_pton6_bad("1.2.3.4"); + test_pton6_bad(":1.2.3.4"); + test_pton6_bad(".2.3.4"); /* test internal checking */ test_external_ip("fbff:ffff::2:7", 0); diff --git a/src/test/test_oom.c b/src/test/test_oom.c index cc6e532358..989ca1203b 100644 --- a/src/test/test_oom.c +++ b/src/test/test_oom.c @@ -82,8 +82,8 @@ add_bytes_to_buf(generic_buffer_t *buf, size_t n_bytes) char b[3000]; while (n_bytes) { - size_t this_add = n_bytes > sizeof(buf) ? sizeof(buf) : n_bytes; - crypto_rand(b, sizeof(b)); + size_t this_add = n_bytes > sizeof(b) ? sizeof(b) : n_bytes; + crypto_rand(b, this_add); generic_buffer_add(buf, b, this_add); n_bytes -= this_add; } diff --git a/src/test/test_policy.c b/src/test/test_policy.c index d2ba1612de..491c9a21fb 100644 --- a/src/test/test_policy.c +++ b/src/test/test_policy.c @@ -417,8 +417,10 @@ test_dump_exit_policy_to_string(void *arg) done: - SMARTLIST_FOREACH(ri->exit_policy, addr_policy_t *, - entry, addr_policy_free(entry)); + if (ri->exit_policy) { + SMARTLIST_FOREACH(ri->exit_policy, addr_policy_t *, + entry, addr_policy_free(entry)); + } tor_free(ri); tor_free(ep); } |