Replace potentially ReDOSable regex

Signed-off-by: PandaNinjas <admin@malwarefight.gq>
This commit is contained in:
PandaNinjas 2023-02-07 17:21:00 +00:00 committed by GitHub
parent f36c3a3f6c
commit d886d32bd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -361,7 +361,7 @@ void InstanceImportTask::processModrinth()
} else { } else {
QString pack_id; QString pack_id;
if (!m_sourceUrl.isEmpty()) { if (!m_sourceUrl.isEmpty()) {
QRegularExpression regex(R"(data\/(.*)\/versions)"); QRegularExpression regex(R"(data\/([^\/]*)\/versions)");
pack_id = regex.match(m_sourceUrl.toString()).captured(1); pack_id = regex.match(m_sourceUrl.toString()).captured(1);
} }