aboutsummaryrefslogtreecommitdiffstats
path: root/mxget.c
diff options
context:
space:
mode:
Diffstat (limited to 'mxget.c')
-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;