Bail out if a configuration file starts with a byte order mark
[users/heiko/exim.git] / src / src / readconf.c
index 95abaf5be8d25bf5513ceb10dd2fe1930f28b9ac..fd9657e0e763d0d3035fd22aa2bee32730fa57a5 100644 (file)
@@ -3469,6 +3469,11 @@ a macro definition. */
 
 while ((s = get_config_line()) != NULL)
   {
+
+  if (config_lineno == 1 && Ustrstr(s, "\xef\xbb\xbf") == s)
+    log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,
+      "found unexpected BOM (Byte Order Mark)");
+
   if (isupper(s[0])) read_macro_assignment(s);
 
   else if (Ustrncmp(s, "domainlist", 10) == 0)