Re: [usbredir v1] usbredirhost: avoid access to null pointer

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

 



Hi,

On Thu, Aug 04, 2016 at 08:30:47AM +0200, Pavel Grunt wrote:
> On Wed, 2016-08-03 at 18:59 +0200, Victor Toso wrote:
> > Another coverity complain.
> Does it say where it is potentially called with null host ?

Oh, indeed it does and the complain makes sense :)

I'll drop this patch and change the ERROR in the snip bellow to
fprintf(stderr, ...) instead.

<snip>
void usbredirhost_set_buffered_output_size_cb(struct usbredirhost *host,
    usbredirhost_buffered_output_size buffered_output_size_func)
{
    if (!host) {
        ERROR("invalid usbredirhost");
        return;
    }

    host->buffered_output_size_func = buffered_output_size_func;
}

Thanks,
  toso




> > ---
> >  usbredirhost/usbredirhost.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
> > index 22c5e39..7d57d40 100644
> > --- a/usbredirhost/usbredirhost.c
> > +++ b/usbredirhost/usbredirhost.c
> > @@ -160,7 +160,7 @@ va_log(struct usbredirhost *host, int level, const char
> > *fmt, ...)
> >      va_list ap;
> >      int n;
> >  
> > -    if (level > host->verbose) {
> > +    if (host == NULL || level > host->verbose) {
> >          return;
> >      }
> >  
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]