From 54ca6ff94a75ae09aad7d8a47cd6b55562f6cfe7 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 22 Sep 2002 22:15:42 +0000 Subject: Bounds-checking fix to prevent remote exploit. svn path=/trunk/; revision=3729 --- mxget.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3