Revision d315353bed0ee4f4a505b8c5fdf24dc63659ae92 authored by Max Reitz on 28 February 2018, 13:13:14 UTC, committed by Michael Roth on 21 June 2018, 01:45:01 UTC
Storing the lseek() result in an int results in it overflowing when the
file is at least 2 GB big.  Then, we have a 50 % chance of the result
being "negative" and thus thinking an error occurred when actually
everything went just fine.

So we should use the correct type for storing the result: off_t.

Reported-by: Daniel P. Berrange <berrange@redhat.com>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1549231
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20180228131315.30194-2-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit 82b45e0a0b824787bd79ce3f6453eaa2afddd138)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
1 parent 332969a
History
File Mode Size
Makefile.objs -rw-r--r-- 783 bytes
checksum.c -rw-r--r-- 5.1 KB
clients.h -rw-r--r-- 2.5 KB
colo-compare.c -rw-r--r-- 28.9 KB
colo.c -rw-r--r-- 5.4 KB
colo.h -rw-r--r-- 2.6 KB
dump.c -rw-r--r-- 9.4 KB
eth.c -rw-r--r-- 15.9 KB
filter-buffer.c -rw-r--r-- 6.2 KB
filter-mirror.c -rw-r--r-- 12.1 KB
filter-replay.c -rw-r--r-- 2.6 KB
filter-rewriter.c -rw-r--r-- 8.9 KB
filter.c -rw-r--r-- 7.5 KB
hub.c -rw-r--r-- 8.1 KB
hub.h -rw-r--r-- 647 bytes
l2tpv3.c -rw-r--r-- 19.5 KB
net.c -rw-r--r-- 44.7 KB
netmap.c -rw-r--r-- 12.4 KB
queue.c -rw-r--r-- 8.0 KB
slirp.c -rw-r--r-- 28.3 KB
socket.c -rw-r--r-- 21.8 KB
tap-bsd.c -rw-r--r-- 6.4 KB
tap-linux.c -rw-r--r-- 8.3 KB
tap-linux.h -rw-r--r-- 1.8 KB
tap-solaris.c -rw-r--r-- 6.7 KB
tap-stub.c -rw-r--r-- 2.1 KB
tap-win32.c -rw-r--r-- 23.3 KB
tap.c -rw-r--r-- 26.2 KB
tap_int.h -rw-r--r-- 2.0 KB
trace-events -rw-r--r-- 1.1 KB
util.c -rw-r--r-- 1.9 KB
util.h -rw-r--r-- 1.3 KB
vde.c -rw-r--r-- 3.6 KB
vhost-user.c -rw-r--r-- 10.6 KB

back to top