mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-28 01:26:59 -04:00
BUG/MEDIUM: tools: off-by-one in quote_arg()
This function may write the \0 one char too far in the static array. There is no effect right now as the function has never been used except maybe in code that was never released. Out-of-tree code might possibly be affected though (hence the MEDIUM flag). No backport is needed. Reported-by: Dinko Korunic <dkorunic@reflected.net>
This commit is contained in:
parent
1a53b5ef58
commit
de2dd6b125
1 changed files with 1 additions and 1 deletions
|
|
@ -1567,7 +1567,7 @@ const char *quote_arg(const char *ptr)
|
|||
if (!ptr || !*ptr)
|
||||
return "end of line";
|
||||
val[0] = '\'';
|
||||
for (i = 1; i < sizeof(val) - 1 && *ptr; i++)
|
||||
for (i = 1; i < sizeof(val) - 2 && *ptr; i++)
|
||||
val[i] = *ptr++;
|
||||
val[i++] = '\'';
|
||||
val[i] = '\0';
|
||||
|
|
|
|||
Loading…
Reference in a new issue