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

Re: [Xen-devel] [Xen-users] Xen 4.2 TODO (io and irq parameter are not evaluated by xl)



Ian Campbell writes ("Re: [Xen-users] Xen 4.2 TODO (io and irq parameter are 
not evaluated by xl)"):
> On Fri, 2012-08-31 at 16:13 +0100, Ian Jackson wrote:
> > This code fails to properly handle (reject)
> >    - (*ep!=0 && *ep!='-')
> 
> Oops, will fix.
> 
> >    - value > LONG_MAX
> >    - INT_MAX < value <= LONG_MAX
> 
> These all get checked inside the (eventual) hypercall. Or were you
> thinking of something else?

Suppose buf contains "1100000055\0".

If a long is 32-bit, strtoul will return ULONG_MAX (0xffffffffUL)
setting errno to ERANGE.  Converting that to a 32-bit signed int will
do something implementation-defined (C99 6.3.1.3(3)) - in reality,
give -1.  Relying on this being rejected later seems poor practice.

If a long is 64-bit and an int 32-bit, strtoul will return
0x1100000055UL.  Converting that to a 32-bit int will again do
something implementation-defined - in reality, give 0x55.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.