From: Ian Jackson Subject: Re: [Xen-users] Xen 4.2 TODO (io and irq parameter are not evaluated by xl) Date: Fri, 31 Aug 2012 16:57:25 +0100 Message-ID: <20544.57061.422450.821411@mariner.uk.xensource.com> References: <1344935141.5926.6.camel@zakaz.uk.xensource.com> <20120814100704.GA19704@bloms.de> <1346421542.27277.218.camel@zakaz.uk.xensource.com> <1346425278.27277.224.camel@zakaz.uk.xensource.com> <20544.54424.775548.66532@mariner.uk.xensource.com> <1346426619.27277.237.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1346426619.27277.237.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Dieter Bloms , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org 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.