Re: [PATCH 2/4] virsh: avoid uninitialized variable

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

 



On Thu, Jun 30, 2011 at 08:14:54AM -0600, Eric Blake wrote:
> Detected by Coverity; neither vshCmddefHelp nor vshCmdOptParse
> was initializing opts_required.
> 
> * tools/virsh.c (vshCmddefOptParse): Always initialize bitmaps.
> ---
>  tools/virsh.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 643f05c..fdb4283 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -11915,12 +11915,15 @@ vshCmddefGetInfo(const vshCmdDef * cmd, const char *name)
>  }
> 
>  static int
> -vshCmddefOptParse(const vshCmdDef *cmd, uint32_t* opts_need_arg,
> +vshCmddefOptParse(const vshCmdDef *cmd, uint32_t *opts_need_arg,
>                    uint32_t *opts_required)
>  {
>      int i;
>      bool optional = false;
> 
> +    *opts_need_arg = 0;
> +    *opts_required = 0;
> +
>      if (!cmd->opts)
>          return 0;
> 

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]