From 5ffc4de1fc0f98e21f3ce19a8277bbdb5f202f71 Mon Sep 17 00:00:00 2001 From: Andrea Guzzo Date: Sun, 27 Apr 2014 14:44:38 +0200 Subject: [PATCH] bugfix: ensure moving the right amount of data and not some random memory (which wouldn't have been used anyway, but still...) --- src/iomux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iomux.c b/src/iomux.c index ffa9cfe..139000f 100644 --- a/src/iomux.c +++ b/src/iomux.c @@ -620,7 +620,7 @@ iomux_write_fd(iomux_t *iomux, int fd, void *priv) MUTEX_LOCK(iomux); iomux->connections[fd]->outlen -= wb; if (iomux->connections[fd]->outlen) { // shift data if we didn't write it all at once - memmove(iomux->connections[fd]->outbuf, &iomux->connections[fd]->outbuf[wb], iomux->connections[fd]->outlen); + memmove(iomux->connections[fd]->outbuf, &iomux->connections[fd]->outbuf[wb], iomux->connections[fd]->outlen - wb); } else { #if defined(HAVE_EPOLL) // let's unregister this fd from EPOLLOUT events (seems nothing needs to be sent anymore)