mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-11 09:52:56 -04:00
BUG/MINOR: httpclient/cli: display junk characters in vsn
ist are not ended by '\0', leading to junk characters being displayed when using %s for printing the HTTP start line. Fix the issue by replacing %s by %.*s + istlen. Must be backported in 2.5.
This commit is contained in:
parent
d544d33e10
commit
de6ecc3ace
1 changed files with 2 additions and 1 deletions
|
|
@ -173,7 +173,8 @@ static int hc_cli_io_handler(struct appctx *appctx)
|
|||
if (!trash)
|
||||
goto out;
|
||||
if (appctx->ctx.cli.i0 & HC_CLI_F_RES_STLINE) {
|
||||
chunk_appendf(trash, "%s %d %s\n",istptr(hc->res.vsn), hc->res.status, istptr(hc->res.reason));
|
||||
chunk_appendf(trash, "%.*s %d %.*s\n", (unsigned int)istlen(hc->res.vsn), istptr(hc->res.vsn),
|
||||
hc->res.status, (unsigned int)istlen(hc->res.reason), istptr(hc->res.reason));
|
||||
if (ci_putchk(si_ic(si), trash) == -1)
|
||||
si_rx_room_blk(si);
|
||||
appctx->ctx.cli.i0 &= ~HC_CLI_F_RES_STLINE;
|
||||
|
|
|
|||
Loading…
Reference in a new issue