summaryrefslogtreecommitdiff
path: root/ares_expand_name.c
diff options
context:
space:
mode:
authorPatrick Valsecchi <pvalsecc@cisco.com>2013-04-15 22:28:01 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-04-15 22:28:01 +0200
commit148c8e0353d93d7c00003da5a0b8eda2079bc8b9 (patch)
tree2b9dca4769d2fb1b380ac8b6beae6b1183d3b402 /ares_expand_name.c
parent2004a7a1115e25128170e40470eba8603f7080da (diff)
downloadc-ares-148c8e0353d93d7c00003da5a0b8eda2079bc8b9.tar.gz
c-ares-148c8e0353d93d7c00003da5a0b8eda2079bc8b9.tar.bz2
c-ares-148c8e0353d93d7c00003da5a0b8eda2079bc8b9.zip
protocol parsing: check input data stricter
... so that bad length fields aren't blindly accepted Bug: http://c-ares.haxx.se/mail/c-ares-archive-2013-04/0016.shtml
Diffstat (limited to 'ares_expand_name.c')
-rw-r--r--ares_expand_name.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ares_expand_name.c b/ares_expand_name.c
index a66dfa9..2aa12bc 100644
--- a/ares_expand_name.c
+++ b/ares_expand_name.c
@@ -143,7 +143,7 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
int n = 0, offset, indir = 0;
/* Allow the caller to pass us abuf + alen and have us check for it. */
- if (encoded == abuf + alen)
+ if (encoded >= abuf + alen)
return -1;
while (*encoded)