From c811a3c6064ca3d1016f7cbb1ece212119e155fb Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 25 Oct 2012 10:01:24 +0200 Subject: [PATCH] fix bug in vmtar Incompatiple types (size_t/ssize_t) can make vmtar to ignore errors. We now compile with -Werror and -Wtype-limits to detect such things. --- Makefile | 6 +++--- changelog.Debian | 6 ++++++ utils.c | 4 ++-- vmtar.c | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7e0a1c6e..7835a2a8 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ RELEASE=2.2 VERSION=2.0 PACKAGE=qemu-server -PKGREL=62 +PKGREL=63 DESTDIR= PREFIX=/usr @@ -35,10 +35,10 @@ vzsyscalls.ph: vzsyscalls.h h2ph -d . vzsyscalls.h vmtar: vmtar.c utils.c - gcc -O2 -Wall -o vmtar vmtar.c + gcc -O2 -Werror -Wall -Wtype-limits -o vmtar vmtar.c sparsecp: sparsecp.c utils.c - gcc -O2 -Wall -o sparsecp sparsecp.c + gcc -O2 -Werror -Wall -Wtype-limits -o sparsecp sparsecp.c %.1.gz: %.1.pod rm -f $@ diff --git a/changelog.Debian b/changelog.Debian index 285ba63f..ef17485a 100644 --- a/changelog.Debian +++ b/changelog.Debian @@ -1,3 +1,9 @@ +qemu-server (2.0-63) unstable; urgency=low + + * fix bug in vmtar + + -- Proxmox Support Team Thu, 25 Oct 2012 10:00:50 +0200 + qemu-server (2.0-62) unstable; urgency=low * vncproxy: wait until vnc port is ready diff --git a/utils.c b/utils.c index 5187940e..c69e0ef5 100644 --- a/utils.c +++ b/utils.c @@ -68,7 +68,7 @@ safe_read(int fd, char *buf, size_t count) int full_read(int fd, char *buf, size_t len) { - size_t n; + ssize_t n; size_t total; total = 0; @@ -110,7 +110,7 @@ safe_write(int fd, char *buf, size_t count) int full_write(int fd, char *buf, size_t len) { - size_t n; + ssize_t n; size_t total; total = 0; diff --git a/vmtar.c b/vmtar.c index 6b34a88b..29160b82 100644 --- a/vmtar.c +++ b/vmtar.c @@ -402,7 +402,7 @@ dump_sparse_file (int fd, struct writebuffer *wbuf, struct sp_array *ma) while (bytes_left > 0) { size_t bufsize = (bytes_left > BLOCKSIZE) ? BLOCKSIZE : bytes_left; - size_t bytes_read; + ssize_t bytes_read; char *blkbuf = buffer_block (wbuf); if ((bytes_read = full_read (fd, blkbuf, bufsize)) < 0) {