size_t outlen = 0;
size_t outlinesize = 0;
int fatal = 0;
+ int missing_lf = -1;
if ((thisline = malloc(sizeof(*thisline) * linesize)) == NULL) {
ha_alert("parsing [%s] : out of memory.\n", file);
char *args[MAX_LINE_ARGS + 1];
char *line = thisline;
+ if (missing_lf != -1) {
+ ha_warning("parsing [%s:%d]: Stray NUL character at position %d. "
+ "This will become a hard error in HAProxy 2.3.\n",
+ file, linenum, (missing_lf + 1));
+ err_code |= ERR_WARN;
+ missing_lf = -1;
+ }
+
linenum++;
if (fatal >= 50) {
/* kill trailing LF */
*(end - 1) = 0;
}
+ else {
+ /* mark this line as truncated */
+ missing_lf = end - line;
+ }
/* skip leading spaces */
while (isspace((unsigned char)*line))
}
}
+ if (missing_lf != -1) {
+ ha_warning("parsing [%s:%d]: Missing LF on last line, file might have been truncated at position %d. "
+ "This will become a hard error in HAProxy 2.3.\n",
+ file, linenum, (missing_lf + 1));
+ err_code |= ERR_WARN;
+ }
+
if (cs && cs->post_section_parser)
err_code |= cs->post_section_parser();