On Thu, Aug 25, 2016 at 18:42:50 -0400, Peter Krempa wrote:
> ../../src/conf/domain_conf.c:4425:21: error: potential null pointer 
> dereference [-Werror=null-dereference]
>          switch (vcpu->hotpluggable) {
>                  ~~~~^~~~~~~~~~~~~~
> ---
>  src/conf/domain_conf.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index ae3eb14..61f6dbb 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -4422,6 +4422,10 @@ virDomainVcpuDefPostParse(virDomainDefPtr def)
>      for (i = 0; i < maxvcpus; i++) {
>          vcpu = virDomainDefGetVcpu(def, i);
> 
> +        /* impossible but some compilers don't like it */
> +        if (!vcpu)
> +            continue;
> +
>          switch (vcpu->hotpluggable) {
>          case VIR_TRISTATE_BOOL_ABSENT:
>              if (vcpu->online)

ACK

Jirka

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

Reply via email to