[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Tweaks on last process-launch patches
commit 6a3e4a89a24fc1e776b84f55ff884b88ef78ceb3
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Wed Aug 31 22:14:38 2011 -0400
Tweaks on last process-launch patches
---
src/common/util.c | 1 +
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 30c298e..7cd9dd8 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 336f95b..06c1be3 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;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits