Re: [glib 1/5] gconfig: Allow schema to be NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/ :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]