]> xenbits.xensource.com Git - libvirt.git/commitdiff
vbox: Address false positive for NULL dereference
authorJohn Ferlan <jferlan@redhat.com>
Thu, 24 Jan 2013 00:34:47 +0000 (19:34 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 25 Jan 2013 22:52:08 +0000 (15:52 -0700)
Resolve a false positive from 'vboxIIDFromUUID_v2_x()'. The code sets
'iid->value = &iid->backing' unconditionally prior to calling 'nsIDFromChar()'.
The 'vboxIIDUnalloc_v2_x()' checks iid->value to not be &iid->backing. The
iid->backing is a static buffer within the initialized structure.

src/vbox/vbox_tmpl.c

index 2b3fa255c4679bc9dd80ac400cf199e9d6b7effc..d2cd0b8c696cb6843e622e52a36553c3e489dc34 100644 (file)
@@ -444,6 +444,7 @@ vboxIIDFromUUID_v2_x(vboxGlobalData *data, vboxIID_v2_x *iid,
 
     iid->value = &iid->backing;
 
+    sa_assert(iid->value);
     nsIDFromChar(iid->value, uuid);
 }