diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-07 23:03:04 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-07 23:03:04 -0400 |
commit | 595303fd1e1998e12c51901f1aea77311e973a44 (patch) | |
tree | 84b18b086564584369b02f7f735a0f98dd4679eb /src/ext | |
parent | 84df7d73c9f8892220184e301627d5bddb9c3f79 (diff) | |
parent | 6d9c332757c96e691ddeb024bd41035490a505d7 (diff) | |
download | tor-595303fd1e1998e12c51901f1aea77311e973a44.tar.gz tor-595303fd1e1998e12c51901f1aea77311e973a44.zip |
Merge remote-tracking branch 'public/bug10363_024_squashed'
Diffstat (limited to 'src/ext')
-rw-r--r-- | src/ext/eventdns.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ext/eventdns.c b/src/ext/eventdns.c index 5ac9c1230c..2b2988f1ec 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; |