|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference |
Date: | Fri, 16 Dec 2011 08:56:17 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |