aboutsummaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-12-11 15:15:21 -0500
committerNick Mathewson <nickm@torproject.org>2014-04-07 22:56:42 -0400
commit6d9c332757c96e691ddeb024bd41035490a505d7 (patch)
tree900c15f0cc295ebe2c5dcd382a01024eb26e9a14 /src/ext
parent9dd115d6b59aaa7d2f444efb9d7992e472fbfb0f (diff)
downloadtor-6d9c332757c96e691ddeb024bd41035490a505d7.tar
tor-6d9c332757c96e691ddeb024bd41035490a505d7.tar.gz
Another 10363 instance -- this one in the eventdns.c code
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/eventdns.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ext/eventdns.c b/src/ext/eventdns.c
index 66280cccd..a64c5627b 100644
--- a/src/ext/eventdns.c
+++ b/src/ext/eventdns.c
@@ -842,10 +842,11 @@ name_parse(u8 *packet, int length, int *idx, char *name_out, size_t name_out_len
}
if (label_len > 63) return -1;
if (cp != name_out) {
- if (cp + 1 >= end) return -1;
+ if (cp >= name_out + name_out_len - 1) return -1;
*cp++ = '.';
}
- if (cp + label_len >= end) return -1;
+ if (label_len > name_out_len ||
+ cp >= name_out + name_out_len - label_len) return -1;
memcpy(cp, packet + j, label_len);
cp += label_len;
j += label_len;