aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-09-22 22:15:42 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-09-22 22:15:42 +0000
commit54ca6ff94a75ae09aad7d8a47cd6b55562f6cfe7 (patch)
tree8ae61d77f1b2a81c7f7f4ec311aa4649550b2d1b
parent845a86af9ca538b8b5a6566afdc8709c6ff0486b (diff)
downloadfetchmail-54ca6ff94a75ae09aad7d8a47cd6b55562f6cfe7.tar.gz
fetchmail-54ca6ff94a75ae09aad7d8a47cd6b55562f6cfe7.tar.bz2
fetchmail-54ca6ff94a75ae09aad7d8a47cd6b55562f6cfe7.zip
Bounds-checking fix to prevent remote exploit.
svn path=/trunk/; revision=3729
-rw-r--r--mxget.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mxget.c b/mxget.c
index 3bb6cd8c..5cc41064 100644
--- a/mxget.c
+++ b/mxget.c
@@ -68,6 +68,8 @@ struct mxentry *getmxrecords(const char *name)
n = res_search(name, C_IN,T_MX, (unsigned char *)&answer, sizeof(answer));
if (n == -1)
return((struct mxentry *)NULL);
+ if (n > sizeof(answer))
+ n = sizeof(answer);
hp = (HEADER *)&answer;
cp = answer + HFIXEDSZ;