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

Re: [libvirt] [PATCH 2/3] conf: Resolve Coverity FORWARD_NULL



On 05/13/2015 12:32 PM, John Ferlan wrote:
> Even though it's been pointed out they are false positives:
>
> http://www.redhat.com/archives/libvir-list/2015-May/msg00301.html
>
> and
>
> http://www.redhat.com/archives/libvir-list/2015-May/msg00302.html
>
> these still show up as Coverity issues. In order to silence Coverity
> add an 'sa_assert' prior to check failure.
>
> Signed-off-by: John Ferlan <jferlan redhat com>
> ---
>  src/conf/domain_conf.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index add857c..5b69b5a 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -23078,6 +23078,7 @@ virDomainObjListCollect(virDomainObjListPtr domlist,
>  {
>      struct virDomainListData data = { NULL, 0 };
>  
> +    sa_assert(domlist->objs);
>      virObjectLock(domlist);

Theoretically domlist->objs could be set to NULL by some other thread
after the sa_asser and before the virObjectLock, but since these are
false positives, the purpose is to shut up coverity, not to actually
check for a non-NULL pointer.

So ACK.


>      if (VIR_ALLOC_N(data.vms, virHashSize(domlist->objs)) < 0) {
>          virObjectUnlock(domlist);
> @@ -23141,6 +23142,7 @@ virDomainObjListConvert(virDomainObjListPtr domlist,
>      }
>      virObjectUnlock(domlist);
>  
> +    sa_assert(*vms);
>      virDomainObjListFilter(vms, nvms, conn, filter, flags);
>  
>      return 0;


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