aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-04-19 12:50:17 -0400
committerNick Mathewson <nickm@torproject.org>2014-04-19 12:52:00 -0400
commit1800e79ca508e555d43eb8ca36e9544f42c98944 (patch)
tree304167d852fc594f65131fdcabaae8472aa8feb8 /src/test
parent5670e38efb8529d3439b8a160e9f19c4147e01ad (diff)
downloadtor-1800e79ca508e555d43eb8ca36e9544f42c98944.tar
tor-1800e79ca508e555d43eb8ca36e9544f42c98944.tar.gz
scan-build: Fix harmless sizeof(ptr) in test_oom.c
We meant to using random bytes to fill a buffer, up to 3000 at a time. Instead we were taking them sizeof(void*) at a time.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_oom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_oom.c b/src/test/test_oom.c
index cc6e53235..989ca1203 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;
}