qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] inet_listen_opts: add error checking


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH v3] inet_listen_opts: add error checking
Date: Fri, 13 Dec 2013 13:47:58 +0100

  Hi,

> parse_uint_full takes an 'unsigned long long *', but you are passing an
> 'int *'.  I'm surprised it compiled for you.  It causes a buffer
> overflow if the pointer is assigned to, and gives different results
> depending on platform endianness.

Fixed in v4.

> > +            error_setg(errp, "can't convert to a number: %s", port);
> > +            return -1;
> > +        }
> > +        if (baseport < 0 || baseport + port_offset > 65535) {
> > +            error_setg(errp, "port %s out of range", port);
> 
> But errno is not set to a sane value at this point, so error_setg() is
> wrong.

That would be true for error_setg_errno()-

cheers,
  Gerd







reply via email to

[Prev in Thread] Current Thread [Next in Thread]