1
0
mirror of http://git.haproxy.org/git/haproxy.git/ synced 2025-03-31 23:58:16 +00:00

BUG/MEDIUM: lua/socket: Buffer error, may segfault

The buffer pointer is already updated. It is again updated
when it is given to the function ci_putblk().

This patch must be backported in 1.6, 1.7 and 1.8
This commit is contained in:
Thierry FOURNIER 2018-05-27 01:14:47 +02:00 committed by Willy Tarreau
parent 101b97619a
commit 66b8919b10

View File

@ -1974,7 +1974,7 @@ static int hlua_socket_write_yield(struct lua_State *L,int status, lua_KContext
/* send data */
if (len < send_len)
send_len = len;
len = ci_putblk(&s->req, buf+sent, send_len);
len = ci_putblk(&s->req, buf, send_len);
/* "Not enough space" (-1), "Buffer too little to contain
* the data" (-2) are not expected because the available length