From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbZ6G-0000ep-HV for qemu-devel@nongnu.org; Fri, 16 Dec 2011 09:49:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbZ6A-00043Y-Lz for qemu-devel@nongnu.org; Fri, 16 Dec 2011 09:49:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbZ6A-00043J-7t for qemu-devel@nongnu.org; Fri, 16 Dec 2011 09:49:22 -0500 Message-ID: <4EEB5A6D.4080705@redhat.com> Date: Fri, 16 Dec 2011 15:49:17 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1324036918-2405-1-git-send-email-pbonzini@redhat.com> <1324036918-2405-2-git-send-email-pbonzini@redhat.com> <4EEB4DE2.2060805@codemonkey.ws> <4EEB4F0C.7050702@redhat.com> <4EEB5152.2010405@codemonkey.ws> <4EEB543C.5030104@redhat.com> <4EEB59CE.809@codemonkey.ws> In-Reply-To: <4EEB59CE.809@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: kwolf@redhat.com, qemu-devel@nongnu.org On 12/16/2011 03:46 PM, Anthony Liguori wrote: >> >> Hmm, then we have to introduce NULL into QJson and visitors. > > Visitors assume that strings aren't nullable (which is actually true in > JSON and in QString). > > I also think that string properties shouldn't be nullable. Unfortunately, qdev string properties are nullable and there might well be examples in which empty and NULL are different. I'd rather not risk. But JSON actually has NULL, so not all is lost. I can introduce a nullable_str type in visitors (restricting structs and arrays should be fine, though). Paolo