From ea654d1ea5b2484f26015ca00a7ff691929c8209 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 16 Jun 2016 17:24:18 +0100 Subject: [PATCH] Fix reading empty tags from plugin descriptions If a plugin's description field contained `{{BASH:}}`, LOOT would extract a Bash Tag with a zero-length name string. This would then cause the user to be unable to save the metadata editor for that plugin, because it would recognise that Bash Tag as being invalid. --- src/backend/plugin/plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/plugin/plugin.cpp b/src/backend/plugin/plugin.cpp index 426924b5..0e26e239 100644 --- a/src/backend/plugin/plugin.cpp +++ b/src/backend/plugin/plugin.cpp @@ -75,7 +75,7 @@ namespace loot { pos1 += 7; size_t pos2 = text.find("}}", pos1); - if (pos2 != string::npos) { + if (pos2 != string::npos && pos1 != pos2) { text = text.substr(pos1, pos2 - pos1); vector bashTags;