BUG/MEDIUM: cfgparse: incorrect memmove in quotes management

The size of the memmove was incorrect (one byte too far) in the quotes
parser and can lead to segfault during configuration parsing.
This commit is contained in:
William Lallemand 2015-05-12 14:01:09 +02:00 committed by Willy Tarreau
parent 6296a11ea4
commit 3f41560f61

View File

@ -6331,7 +6331,7 @@ int readcfgfile(const char *file)
dquote = 0;
else
dquote = 1;
memmove(line, line + 1, end - (line + 1));
memmove(line, line + 1, end - line);
end--;
}
else if (*line == '\'' && !dquote) { /* single quote outside double quotes */
@ -6339,7 +6339,7 @@ int readcfgfile(const char *file)
squote = 0;
else
squote = 1;
memmove(line, line + 1, end - (line + 1));
memmove(line, line + 1, end - line);
end--;
}
else if (*line == '\\' && !squote) {