Heiko Schlittermann, 2011-02-13 14:07:
> +  if (config_lineno == 1 && Ustrstr(s, "\xef\xbb\xbf") == s) 

I would generalize that: A byte value > 0x7f at this point means, that
there's something wrong. So I'd prefer something like this:

if (config_lineno == 1 && (s[0] < 0x20 || s[0] > 0x7e ))

(with logging something like "invalid char '%hhc' at start of config file").

This would catch all cases listed in
http://en.wikipedia.org/wiki/Byte-order_mark#Representations_of_byte_order_marks_by_encoding,
except "UTF-32 (BE)" (which is hard to handle with it's starting 0
octet, as we don't know the line length), but I guess that's good enough
(or at least better that what we have right now).

-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to