[libvirt] [PATCH v2 6/6] xenapi: Resolve Coverity FORWARD_NULL
pkrempa at redhat.com
Wed Oct 7 06:40:11 UTC 2015
Subject is technically right, but entirely misleading. This patch is
more a refactor of the code that fixes a coverity error rather than the
other way around.
On Fri, Sep 25, 2015 at 12:31:45 -0400, John Ferlan wrote:
> Coverity flagged that if the input 'mask'parameter was NULL, then the
> strtok_r call would have a NULL first and third parameter, which would
> cause an issue.
> Although the caller doesn't call getCpuBitMapfromString with a non-NULL
> mask value, Coverity doesn't check that. A fix could have been to check
So a false positive again?
> the 'mask' in the function and keep Coverity happy; however, it was noted
> in a previous review that virBitmap* functions could be used instead.
> So this patch modifies xenapiDomainGetVcpus to use virBitmap* functions
> and removes getCpuBitMapfromString in favor of those.
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> src/xenapi/xenapi_driver.c | 12 +++++++-----
> src/xenapi/xenapi_utils.c | 21 ---------------------
> src/xenapi/xenapi_utils.h | 2 --
> 3 files changed, 7 insertions(+), 28 deletions(-)
This makes me like this patch though.
ACK if you fix the commit message.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: Digital signature
More information about the libvir-list