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:13:28 +0100 Message-ID: <20544.54424.775548.66532@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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1346425278.27277.224.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)"): > libxl/xl: implement support for guest iooprt and irq permissions. Most of this looks good, but: ... ("bios", libxl_bios_type), > + buf = xlu_cfg_get_listitem (ioports, i); > + if (!buf) { > + fprintf(stderr, > + "xl: Unable to get element #%d in ioport list\n", i); > + exit(1); > + } > + s = e = strtoul(buf, &ep, 16); > + if (ep == buf) { > + fprintf(stderr, "xl: Invalid argument parsing ioport: %s\n", > + buf); > + exit(1); > + } > + if (*ep == '-') { This code fails to properly handle (reject) - (*ep!=0 && *ep!='-') - value > LONG_MAX - INT_MAX < value <= LONG_MAX - *ep2!=0 > + irq = strtoul(buf, &ep, 10); Likewise. I take it we're not worrying about missing malloc failure checks in xl. Ian.