[CRIU] [PATCH] Fixed OVERFLOW_BEFORE_WIDEN issue introduced by remote images code.

rodrigo-bruno rbruno at gsd.inesc-id.pt
Sun Mar 19 14:55:23 PDT 2017


Signed-off-by: rodrigo-bruno <rbruno at gsd.inesc-id.pt>
---
 criu/img-remote-proto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/img-remote-proto.c b/criu/img-remote-proto.c
index 3751b6f..51584bb 100644
--- a/criu/img-remote-proto.c
+++ b/criu/img-remote-proto.c
@@ -743,7 +743,7 @@ int64_t send_image(int fd, struct rimage *rimg, int flags, bool close_fd)
 			} else if (rimg->curr_sent_bytes == rimg->curr_sent_buf->nbytes) {
 				if (close_fd)
 					close(fd);
-			       return nblocks*BUF_SIZE + rimg->curr_sent_buf->nbytes;
+			       return ((int64_t)nblocks*BUF_SIZE) + rimg->curr_sent_buf->nbytes;
 			}
 		} else if (errno == EPIPE || errno == ECONNRESET) {
 			pr_warn("Connection for %s:%s was closed early than expected\n",
-- 
2.1.4



More information about the CRIU mailing list