From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh1mE-00068H-6v for qemu-devel@nongnu.org; Tue, 19 Jun 2012 12:59:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sh1m9-0003EC-Bd for qemu-devel@nongnu.org; Tue, 19 Jun 2012 12:59:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh1m9-0003E4-3O for qemu-devel@nongnu.org; Tue, 19 Jun 2012 12:59:33 -0400 Message-ID: <4FE0AFE9.4040805@redhat.com> Date: Tue, 19 Jun 2012 10:59:21 -0600 From: Eric Blake MIME-Version: 1.0 References: <1340120601-24747-1-git-send-email-owasserm@redhat.com> <1340120601-24747-6-git-send-email-owasserm@redhat.com> In-Reply-To: <1340120601-24747-6-git-send-email-owasserm@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig6DA5CA2A871154F36675337C" Subject: Re: [Qemu-devel] [PATCH v12 05/13] Add uleb encoding/decoding functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Orit Wasserman Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, quintela@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, blauwirbel@gmail.com, avi@redhat.com, pbonzini@redhat.com, chegu_vinod@hp.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig6DA5CA2A871154F36675337C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/19/2012 09:43 AM, Orit Wasserman wrote: > Implement Unsigned Little Endian Base 128. >=20 > Signed-off-by: Orit Wasserman > --- > cutils.c | 29 +++++++++++++++++++++++++++++ > qemu-common.h | 8 ++++++++ > 2 files changed, 37 insertions(+), 0 deletions(-) >=20 > +int uleb128_decode_small(const uint8_t *in, uint32_t *n) > +{ > + if (!(*in & 0x80)) { > + *n =3D *in++; > + return 1; > + } else { > + *n =3D *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? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig6DA5CA2A871154F36675337C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJP4K/pAAoJEKeha0olJ0NqUZEIAJlcbPYcka+OeIA+1tO6PLLe n18RxHJ6RTQ7M5U3ixv37GwdygsKqU8WPjohWq+4xd+LqtHb+REoLkDRofmZfCNy Rx68Yl9Mmht94zCDGdS0jR0zejq+CIQw0ExHT9xYTnnAERFAKiTDh+qfU2ko2FMH GHJfdVzO7GjgDHQPcv7OTBRzuXS0UUIyx/9JfuHUkNiXh7KfI3pId9kX94JsFhZa lK41cntF7o9EXnSSh9qXqm9fzDMm2rDGtR4kpLdE/8vsJ2Xu/2edYRFl3+4s/DfY JybN2z9A+0/mAXTqsdmcQvDg/nZnLvvtxDikMIVnCuyRT4GUR1IgRCp8+eUiIvs= =Qfgx -----END PGP SIGNATURE----- --------------enig6DA5CA2A871154F36675337C--