[PATCH] multipathd: fix read past end of of buffer in sending reply

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reduce the send() length for the uxlsnr reply, by the number of bytes
already sent

Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
---
 multipathd/uxlsnr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c
index 23cb123d..238744b7 100644
--- a/multipathd/uxlsnr.c
+++ b/multipathd/uxlsnr.c
@@ -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;
-- 
2.17.2

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux