Client: don't crash when <exclude_gpu> has bad device #

This commit is contained in:
davidpanderson 2022-08-28 01:26:16 -07:00
parent 4655fce0b4
commit ff7ea08957
1 changed files with 3 additions and 0 deletions

View File

@ -274,6 +274,9 @@ int EXCLUDE_GPU::parse(XML_PARSER& xp) {
if (!xp.is_tag) continue;
if (xp.match_tag("/exclude_gpu")) {
if (!found_url) return ERR_XML_PARSE;
if (device_num >= MAX_COPROC_INSTANCES) {
return ERR_XML_PARSE;
}
return 0;
}
if (xp.parse_string("url", url)) {