From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbZCx-0003NA-AN for qemu-devel@nongnu.org; Fri, 16 Dec 2011 09:56:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbZCw-0005WR-0o for qemu-devel@nongnu.org; Fri, 16 Dec 2011 09:56:23 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:43602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbZCv-0005WI-TM for qemu-devel@nongnu.org; Fri, 16 Dec 2011 09:56:21 -0500 Received: by iagj37 with SMTP id j37so5091207iag.4 for ; Fri, 16 Dec 2011 06:56:21 -0800 (PST) Message-ID: <4EEB5C11.5040907@codemonkey.ws> Date: Fri, 16 Dec 2011 08:56:17 -0600 From: Anthony Liguori 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> <4EEB5A6D.4080705@redhat.com> In-Reply-To: <4EEB5A6D.4080705@redhat.com> 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: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org On 12/16/2011 08:49 AM, Paolo Bonzini wrote: > 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). I'd really prefer to stick to non-nullable strings as there is no obvious way to specify NULL in command line options. What are the uses of null in qdev string properties? I know you can't set a string to null since parse() doesn't have a null syntax. So we're really just talking about an uninitialized state, right? Regards, Anthony Liguori > > Paolo >