From 93805cd167345e3bdd956263a495853b36184480 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 6 Jul 2021 23:07:31 +0700 Subject: [PATCH] #2476 Fixed crash in DMI memory reader. --- src/hw/dmi/DmiMemory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hw/dmi/DmiMemory.cpp b/src/hw/dmi/DmiMemory.cpp index 883c89b5..a07f5b55 100644 --- a/src/hw/dmi/DmiMemory.cpp +++ b/src/hw/dmi/DmiMemory.cpp @@ -230,6 +230,10 @@ void xmrig::DmiMemory::setId(const char *slot, const char *bank) m_slot = slot; m_bank = bank; + if (!slot || !bank) { + return; + } + try { std::cmatch cm; if (std::regex_match(slot, cm, std::regex("^Channel([A-Z])[-_]DIMM(\\d+)$", std::regex_constants::icase))) {