mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-26 16:21:22 +02:00
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:
parent
6296a11ea4
commit
3f41560f61
@ -6331,7 +6331,7 @@ int readcfgfile(const char *file)
|
|||||||
dquote = 0;
|
dquote = 0;
|
||||||
else
|
else
|
||||||
dquote = 1;
|
dquote = 1;
|
||||||
memmove(line, line + 1, end - (line + 1));
|
memmove(line, line + 1, end - line);
|
||||||
end--;
|
end--;
|
||||||
}
|
}
|
||||||
else if (*line == '\'' && !dquote) { /* single quote outside double quotes */
|
else if (*line == '\'' && !dquote) { /* single quote outside double quotes */
|
||||||
@ -6339,7 +6339,7 @@ int readcfgfile(const char *file)
|
|||||||
squote = 0;
|
squote = 0;
|
||||||
else
|
else
|
||||||
squote = 1;
|
squote = 1;
|
||||||
memmove(line, line + 1, end - (line + 1));
|
memmove(line, line + 1, end - line);
|
||||||
end--;
|
end--;
|
||||||
}
|
}
|
||||||
else if (*line == '\\' && !squote) {
|
else if (*line == '\\' && !squote) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user