From ff7ea08957c1dcd806042cbca8a925f6606702f1 Mon Sep 17 00:00:00 2001 From: davidpanderson Date: Sun, 28 Aug 2022 01:26:16 -0700 Subject: [PATCH] Client: don't crash when has bad device # --- lib/cc_config.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/cc_config.cpp b/lib/cc_config.cpp index bcbfef9ea2..5ec10458a3 100644 --- a/lib/cc_config.cpp +++ b/lib/cc_config.cpp @@ -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)) {