From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAjxX-0003a8-7Y for qemu-devel@nongnu.org; Mon, 03 Oct 2011 10:57:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAjxU-00015c-P6 for qemu-devel@nongnu.org; Mon, 03 Oct 2011 10:57:35 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:59002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAjxU-00015Y-In for qemu-devel@nongnu.org; Mon, 03 Oct 2011 10:57:32 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e9.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p93ELZVD027516 for ; Mon, 3 Oct 2011 10:21:35 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p93EvA7m075568 for ; Mon, 3 Oct 2011 10:57:12 -0400 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p93Eun5A002941 for ; Mon, 3 Oct 2011 08:56:51 -0600 Message-ID: <4E89CD2F.7010707@us.ibm.com> Date: Mon, 03 Oct 2011 09:56:47 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1316443309-23843-1-git-send-email-mdroth@linux.vnet.ibm.com> <4E88C7DB.9090105@linux.vnet.ibm.com> <20111002210802.GC8072@redhat.com> <4E89B0D4.3090203@us.ibm.com> <4E89B43B.4080000@linux.vnet.ibm.com> <4E89B627.7010008@us.ibm.com> <20111003133040.GC18920@redhat.com> <4E89BD15.1040708@codemonkey.ws> <20111003141852.GD19689@redhat.com> In-Reply-To: <20111003141852.GD19689@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: aliguori@linux.vnet.ibm.com, Stefan Berger , qemu-devel@nongnu.org, Michael Roth On 10/03/2011 09:18 AM, Michael S. Tsirkin wrote: >> skip_indefinite: >> while tag != CANARY: >> if tag == INT: >> visit_type_int(v, NULL, NULL, errp); >> elif tag == STRING: >> visit_type_str(v, NULL, NULL, errp); >> elif tag == INDEFINITE: >> visit_start_struct(v, NULL, NULL, errp); >> skip_indefinite(v, errp); >> visit_end_struct(v, NULL, NULL, errp); >> >> end_struct: >> v->skip = true; >> skip_indefinite(v, errp); >> v->skip = false; >> >> Regards, >> >> Anthony Liguori > > This implementation is recursive, which has the problem > of wasting unlimited resources to skip bad input. > And we really do not need to look at tag at all. Just > the length. That's just one implementation. You could certainly do a non-recursive implementation. Regards, Anthony Liguori >