summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-04-19 12:36:49 -0400
committerNick Mathewson <nickm@torproject.org>2011-04-19 12:36:49 -0400
commit177cadff8d4ca01aad21abea44c7ecc0731525d6 (patch)
tree13d7602c04fa777685f76a0b3258786a93e24a83 /src/or/routerparse.c
parent0e554f93d677fefc649d103ed08ba298c27b3fed (diff)
parent48bdc2f729cba1a22305f6150d230cf0334ebd55 (diff)
downloadtor-177cadff8d4ca01aad21abea44c7ecc0731525d6.tar.gz
tor-177cadff8d4ca01aad21abea44c7ecc0731525d6.zip
Merge remote-tracking branch 'rransom/bug2948' into maint-0.2.2
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 8456a0a02d..dd72eb6bb4 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -4638,12 +4638,12 @@ rend_parse_v2_service_descriptor(rend_service_descriptor_t **parsed_out,
else
eos = eos + 1;
/* Check length. */
- if (strlen(desc) > REND_DESC_MAX_SIZE) {
+ if (eos-desc > REND_DESC_MAX_SIZE) {
/* XXX023 If we are parsing this descriptor as a server, this
* should be a protocol warning. */
log_warn(LD_REND, "Descriptor length is %i which exceeds "
"maximum rendezvous descriptor size of %i bytes.",
- (int)strlen(desc), REND_DESC_MAX_SIZE);
+ (int)(eos-desc), REND_DESC_MAX_SIZE);
goto err;
}
/* Tokenize descriptor. */