diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-08-31 22:14:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-08-31 22:14:38 -0400 |
commit | 6a3e4a89a24fc1e776b84f55ff884b88ef78ceb3 (patch) | |
tree | d6de8a163206fb0585dd641230e62c0439d66c4b | |
parent | 5b8a20ed447f11cda2e0bf528dd78e41e4b76fa4 (diff) | |
download | tor-6a3e4a89a24fc1e776b84f55ff884b88ef78ceb3.tar tor-6a3e4a89a24fc1e776b84f55ff884b88ef78ceb3.tar.gz |
Tweaks on last process-launch patches
-rw-r--r-- | src/common/util.c | 1 | ||||
-rw-r--r-- | src/test/test_util.c | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c index 30c298e0d..7cd9dd8e0 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -3616,6 +3616,7 @@ tor_read_all_handle(FILE *h, char *buf, size_t count, } } tor_assert(retval != NULL); + tor_assert(strlen(retval) + numread <= count); numread += strlen(retval); } diff --git a/src/test/test_util.c b/src/test/test_util.c index 336f95b14..06c1be3e3 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -1647,8 +1647,7 @@ test_util_split_lines(void *ptr) for (i=0; tests[i].orig_line; i++) { sl = smartlist_create(); /* Allocate space for string and trailing NULL */ - orig_line = tor_malloc(tests[i].orig_length + 1); - memcpy(orig_line, tests[i].orig_line, tests[i].orig_length + 1); + orig_line = tor_memdup(tests[i].orig_line, tests[i].orig_length + 1); tor_split_lines(sl, orig_line, tests[i].orig_length); j = 0; |