On 06/19/2012 09:43 AM, Orit Wasserman wrote: > Implement Unsigned Little Endian Base 128. > > Signed-off-by: Orit Wasserman <[email protected]> > --- > cutils.c | 29 +++++++++++++++++++++++++++++ > qemu-common.h | 8 ++++++++ > 2 files changed, 37 insertions(+), 0 deletions(-) >
> +int uleb128_decode_small(const uint8_t *in, uint32_t *n)
> +{
> + if (!(*in & 0x80)) {
> + *n = *in++;
> + return 1;
> + } else {
> + *n = *in++ & 0x7f;
> + g_assert(!(*in & 0x80));
Are we really okay calling g_assert() in the middle of an incoming
migration, or are there more graceful ways to fail when dealing with
invalid user input?
--
Eric Blake [email protected] +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
