summaryrefslogtreecommitdiff
path: root/src/common/container.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-19 23:29:45 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-19 23:29:45 +0000
commit42c4670e27fe5bdc694875cddedc5151fe8c5244 (patch)
tree56968be60690d89f055663a65a2d67819f43eb89 /src/common/container.c
parent319c0d89337312aa553a21c39dbba8eafd385e53 (diff)
downloadtor-42c4670e27fe5bdc694875cddedc5151fe8c5244.tar.gz
tor-42c4670e27fe5bdc694875cddedc5151fe8c5244.zip
r18230@catbus: nickm | 2008-02-19 18:29:43 -0500
Add a few asserts to catch possible errors found by veracode. svn:r13598
Diffstat (limited to 'src/common/container.c')
-rw-r--r--src/common/container.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/common/container.c b/src/common/container.c
index e1ed67856b..b138c9273c 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -90,6 +90,7 @@ void
smartlist_add_all(smartlist_t *s1, const smartlist_t *s2)
{
smartlist_ensure_capacity(s1, s1->num_used + s2->num_used);
+ tor_assert(s1->capacity >= s1->num_used+s2->num_used);
memcpy(s1->list + s1->num_used, s2->list, s2->num_used*sizeof(void*));
s1->num_used += s2->num_used;
}