[libvirt] [PATCHv1.5 17/27] snapshot: conf: Fix NULL dereference when <driver> element is empty

Peter Krempa pkrempa at redhat.com
Mon Dec 2 14:01:09 UTC 2013


On 11/27/13 12:15, Michal Privoznik wrote:
> On 26.11.2013 17:48, Peter Krempa wrote:
>> Consider the following valid snapshot XML as the <driver> element is
>> allowed to be empty in the domainsnapshot.rng schema:
>>
>> $ cat snap.xml
>> <domainsnapshot>
>>   <disks>
>>     <disk name='vda' snapshot='external'>
>>       <source file='/tmp/foo'/>
>>       <driver/>
>>     </disk>
>>   </disks>
>> </domainsnapshot>
>>
>> produces the following error:
>>
>> $ virsh snapshot-create domain snap.xml
>> error: internal error: unknown disk snapshot driver '(null)'
>>
>> The driver type is parsed as NULL from the XML as the attribute is not
>> present and then directly used to produce the error message.
>>
>> With this patch the attempt to parse the driver type is skipped if not
>> present to avoid changing the schema to forbid the empty driver element.
>> ---
>>  src/conf/snapshot_conf.c | 16 +++++++++-------
>>  1 file changed, 9 insertions(+), 7 deletions(-)
>>

...

>>
> 
> ACK and worth backporting on *-maint branches.

Thanks; Pushed. The backport won't be clean unless a few other patches
are backported, thus I will not do it until somebody will complain.

Peter



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131202/8baa1591/attachment-0001.sig>


More information about the libvir-list mailing list