From: T.Kobayashi <tk...@ii...> - 2004-12-13 02:28:39
|
Hi. I found sid-milter's bug in MX priority sorting (version 0.2.4). This bug causes lack of one record which is result of MX query. Affected case is below(any record match '-all'): example.com IN TXT v=spf1 +mx -all example.com IN MX 10 mx1.example.com Fix is below: <sid-filter/sid-filter.c:1073> /* sort MX list */ for (n = 0; n < nmx; n++) { - if (prec[n] > prec[n + 1]) + if((n + 1 < nmx) && prec[n] > prec[n + 1]) { m = prec[n]; prec[n] = prec[n + 1]; prec[n + 1] = m; sm_strlcpy(qname, mxes[n], sizeof qname); sm_strlcpy(mxes[n], mxes[n + 1], sizeof mxes[n]); sm_strlcpy(mxes[n + 1], qname, sizeof mxes[n + 1]); } } -- T.Kobayashi <tk...@ii...> |