qemu/util
Shmulik Ladkani e911765cbb util: Fix assertion in iov_copy() upon zero 'bytes' and non-zero 'offset'
In cases where iov_copy() is passed with zero 'bytes' argument and a
non-zero 'offset' argument, nothing gets copied - as expected.

However no copy iterations are performed, so 'offset' is left
unaltered, leading to the final assert(offset == 0) to fail.

Instead, change the loop condition to continue as long as 'offset || bytes',
similar to other iov_* functions.

This ensures 'offset' gets zeroed (even if no actual copy is made),
unless it is beyond end of source iov - which is asserted.

Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Message-Id: <1470130880-1050-1-git-send-email-shmulik.ladkani@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-08-03 18:44:57 +02:00
..
acl.c Drop Emacs local variables lists redundant with .dir-locals.el 2016-07-12 16:19:16 +02:00
base64.c
bitmap.c
bitops.c
buffer.c
compatfd.c
coroutine-gthread.c
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
crc32c.c
cutils.c target-arm: Use Neon for zero checking 2016-07-14 16:51:36 +01:00
envlist.c
error.c
event_notifier-posix.c
event_notifier-win32.c
fifo8.c
getauxval.c
hbitmap.c
hexdump.c
host-utils.c
id.c
iov.c util: Fix assertion in iov_copy() upon zero 'bytes' and non-zero 'offset' 2016-08-03 18:44:57 +02:00
log.c log: Permit -dfilter 0..0xffffffffffffffff 2016-07-04 16:49:33 +03:00
Makefile.objs range: Create range.c for code that should not be inline 2016-06-30 15:28:40 +02:00
memfd.c
mmap-alloc.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
module.c
notify.c
osdep.c osdep: Introduce qemu_dup 2016-07-13 13:26:02 +02:00
oslib-posix.c fix qemu exit on memory hotplug when allocation fails at prealloc time 2016-08-02 12:03:58 +02:00
oslib-win32.c fix qemu exit on memory hotplug when allocation fails at prealloc time 2016-08-02 12:03:58 +02:00
path.c
qdist.c qdist: return "(empty)" instead of NULL when printing an empty dist 2016-08-03 18:44:56 +02:00
qemu-config.c
qemu-coroutine-io.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-coroutine-lock.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-coroutine-sleep.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-coroutine.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-error.c
qemu-openpty.c
qemu-option.c
qemu-progress.c
qemu-sockets.c util: Drop inet_listen() 2016-08-02 12:03:58 +02:00
qemu-thread-posix.c
qemu-thread-win32.c
qemu-timer-common.c
qht.c qht: do not segfault when gathering stats from an uninitialized qht 2016-08-02 12:03:58 +02:00
range.c range: Replace internal representation of Range 2016-07-04 16:49:33 +03:00
rcu.c
readline.c
rfifolock.c
throttle.c
timed-average.c
trace-events
unicode.c
uri.c