aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-19 23:57:06 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-19 23:57:06 +0000
commit260c37c14c75ca869c04da9837b533b8b250a06b (patch)
tree74dc52da7195b48cd833b33e7f88d5be5c6a8639
parent913f66278c5be1454639ebc566aa685602dc53d7 (diff)
downloadtor-260c37c14c75ca869c04da9837b533b8b250a06b.tar.gz
tor-260c37c14c75ca869c04da9837b533b8b250a06b.zip
r18236@catbus: nickm | 2008-02-19 18:55:21 -0500
Explain why I am right and veracode is wrong in routerparse.c line 1141. Using math! svn:r13602
-rw-r--r--src/or/routerparse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 9a22a0ed61..123ea32bc1 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1133,6 +1133,12 @@ router_parse_entry_from_string(const char *s, const char *end,
memcpy(cp, prepend_annotations, prepend_len);
cp += prepend_len;
}
+ /* This assertion will always succeed.
+ * len == signed_desc_len + annotations_len
+ * == end-s + s-start_of_annotations + prepend_len
+ * == end-start_of_annotations + prepend_len
+ * We already wrote prepend_len bytes into the buffer; now we're
+ * writing end-start_of_annotations -NM. */
tor_assert(cp+(end-start_of_annotations) ==
router->cache_info.signed_descriptor_body+len);
memcpy(cp, start_of_annotations, end-start_of_annotations);