qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v12 05/13] Add uleb encoding/decoding functions


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v12 05/13] Add uleb encoding/decoding functions
Date: Tue, 19 Jun 2012 10:59:21 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0

On 06/19/2012 09:43 AM, Orit Wasserman wrote:
> Implement Unsigned Little Endian Base 128.
> 
> Signed-off-by: Orit Wasserman <address@hidden>
> ---
>  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   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org



Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]