From: Luyao Huang Date: Fri, 12 Dec 2014 02:32:54 +0000 (+0800) Subject: conf: goto error when value of max_sectors is too large X-Git-Tag: v1.2.9.2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d109b7ce2590036dcde887137547fe04e4b1b4d1;p=thirdparty%2Flibvirt.git conf: goto error when value of max_sectors is too large Output error when we try to set a too large max_sectors. Just like queues and cmd_per_lun here. Signed-off-by: Luyao Huang (cherry picked from commit ce1d2f63152290098450fa2beecdee79cf929456) Signed-off-by: Ján Tomko --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2ea57ac85c..6b64f51002 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6435,6 +6435,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, if (max_sectors && virStrToLong_ui(max_sectors, NULL, 10, &def->max_sectors) < 0) { virReportError(VIR_ERR_XML_ERROR, _("Malformed 'max_sectors' value %s'"), max_sectors); + goto error; } if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0)