On Tue, Nov 01, 2016 at 05:46:03PM +0100, Zeeshan Ali wrote:
Validation (if attempted) should just fail in this case instead of
crashing.
---
libvirt-gconfig/libvirt-gconfig-object.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-object.c
b/libvirt-gconfig/libvirt-gconfig-object.c
index 6225de2..851e35c 100644
--- a/libvirt-gconfig/libvirt-gconfig-object.c
+++ b/libvirt-gconfig/libvirt-gconfig-object.c
@@ -209,6 +209,14 @@ void gvir_config_object_validate(GVirConfigObject *config,
return;
}
+ if (!priv->schema) {
+ gvir_config_set_error_literal(err,
+ GVIR_CONFIG_OBJECT_ERROR,
+ 0,
+ _("No XML schema associated with this config
object"));
+ return;
+ }
+
rngParser = xmlRelaxNGNewParserCtxt(priv->schema);
if (!rngParser) {
gvir_config_set_error(err,
--
ACK
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://entangle-photo.org -o-
http://search.cpan.org/~danberr/ :|