From b9deed2d06c5c2f55c863fd7009486084d61544b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 29 Jan 2026 11:33:12 +0100 Subject: [PATCH] schrack: Fix version regular expression in the discovery --- schrack/ciondiscovery.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schrack/ciondiscovery.cpp b/schrack/ciondiscovery.cpp index 14bb31a..b886ad2 100644 --- a/schrack/ciondiscovery.cpp +++ b/schrack/ciondiscovery.cpp @@ -84,7 +84,8 @@ void CionDiscovery::tryConnect(ModbusRtuMaster *master, quint16 slaveId) // Examples of how this looks like: // EBE 1.2: "V1.2 15.02.2021" // ICC: "003090056-01 20220913" - if (QRegularExpression("[A-Z0-9\\.- ]{18,32}").match(firmwareVersion).hasMatch()) { + // Regex accepts uppercase letters, digits, dots, spaces and dashes; dash is escaped to avoid invalid range + if (QRegularExpression(QStringLiteral("[A-Z0-9. \\-]{18,32}")).match(firmwareVersion).hasMatch()) { Result result {master->modbusUuid(), firmwareVersion, slaveId}; m_discoveryResults.append(result); }