multipathd: fix read past end of of buffer in sending reply
Benjamin Marzinski
maintainerPATCH 1/1 multipathd: fix read past end of of buffer in sending reply
Reduce the send() length for the uxlsnr reply, by the number of bytes already sent
Signed-off-by Benjamin Marzinski <[email protected]>
--- multipathd/uxlsnr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
multipathd/uxlsnr.c +1 -1
@@ -541,7 +541,7 @@ static int client_state_machine(struct client *c, struct vectors *vecs,if (c->len < c->cmd_len) {const char *buf =get_strbuf_str (&c->reply); - n =send (c->fd, buf + c->len, c->cmd_len,MSG_NOSIGNAL ); + n =send (c->fd, buf + c->len, c->cmd_len - c->len,MSG_NOSIGNAL );if (n ==-1 ) {if (!(errno ==EAGAIN || errno ==EINTR )) c->error = -ECONNRESET ;
Signature · 6 lines
2.17.2 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 4 lines · Benjamin Marzinski
Reduce the
send()length for the uxlsnr reply, by the number of bytes already sentSigned-off-by Benjamin Marzinski <[email protected]>
Reviewed-by Martin Wilck <[email protected]>
Quoted 16 lines
---
multipathd/uxlsnr.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)multipathd/uxlsnr.c +0
-0@@ -541,7 +541,7 @@ static int client_state_machine(struct client *c, struct vectors *vecs, if (c->len < c->cmd_len) { const char *buf = get_strbuf_str(&c->reply);
- n =send(c->fd, buf + c->len, c->cmd_len, MSG_NOSIGNAL);
+ n = send(c->fd, buf +c->len,c->cmd_len- c-
Quoted 5 lines
Quoted 1 line
len,
MSG_NOSIGNAL);if (n == -1) {
if (!(errno == EAGAIN || errno == EINTR))
c->error =-ECONNRESET;
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel