libxl__device_disk_dev_number() can parse a virtpath which is an encoded
unsigned long but does not set *pdisk or *ppartition in that case.
Ideally we would parse the number but for now simply fail to prevent cascading
failures.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
errno = 0;
ul = strtoul(virtpath, &ep, 0);
- if (!errno && !*ep && ul <= INT_MAX)
+ if (!errno && !*ep && ul <= INT_MAX) {
+ /* FIXME: should parse ul to determine these. */
+ if (pdisk || ppartition)
+ return -1;
return ul;
+ }
if (device_virtdisk_matches(virtpath, "hd",
&disk, 3,