In <000901c4585e$4af4bde0$01030101(_at_)pamho(_dot_)net> "Roger Moser"
<roger_moser_spf(_at_)greenmail(_dot_)ch> writes:
Hector Santos wrote:
int j = 0;
for (int i = 0; i < RR.RDlength; i++) {
int ch = RRBuffer[position+i];
if ((ch > 127) || (ch < 32)) {
continue;
}
// 255 mod check
if ((i == 0) || ((i % 255) != 0)) {
rec.szTXT[j] = ch;
j++;
}
}
This routine is incorrect because it assumes that all substrings have 255
characters which is not always the case.
Yep. It is perfectly valid to have a TXT record such as:
@ TXT "v=spf1 " "a " "mx " "include:foo.com " "-all"
This creates 5 substrings.
Correct is (no guarantee):
Well the other problem that I see is throwing out invalid characters.
You should not be able to take TXT record filled with random garbage,
filter out all the "invalid" stuff and end up with a "valid" SPF
record.
-wayne