]> xenbits.xensource.com Git - libvirt.git/commit
vbox_snapshot_conf: Parse XMLs without net access
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 20 Nov 2023 03:49:53 +0000 (04:49 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 21 Nov 2023 13:23:05 +0000 (14:23 +0100)
commitd8cb1cd50c608eb647fcb17c4347a2e9d5004e8d
treecbe17ddf83a96bbf9861d6f3b788af0d8d774e79
parentb31380c7583d144380e3a3b7affccfefccff41f9
vbox_snapshot_conf: Parse XMLs without net access

When working with VirtualBox's snapshots, the snapshot XML is
firstly parsed, stored in memory (with some parts being stored as
verbatim XML snippets, strings), requested changes are made and
then this modified XML is formatted via
virVBoxSnapshotConfSaveVboxFile() which calls
xmlParseInNodeContext() to format those previously stored XML
snippets.

The first parse of whole VirtualBox snapshot file is done using
virXMLParse() (in virVBoxSnapshotConfLoadVboxFile()) and thus
with XML_PARSE_NONET specified.

But those ad-hoc parsings when formatting the XML back pass zero
flags mask: xmlParseInNodeContext(..., options = 0, ...);

This is potentially dangerous.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/vbox/vbox_snapshot_conf.c