diff --git a/es-core/src/utils/StringUtil.cpp b/es-core/src/utils/StringUtil.cpp index cb3d1cc3b..9440f0f35 100644 --- a/es-core/src/utils/StringUtil.cpp +++ b/es-core/src/utils/StringUtil.cpp @@ -606,6 +606,10 @@ namespace Utils replaced.append(result.substr(lastPos)); result = replaced; + + // Prevent endless loops. + if (to.find(from) != std::string::npos) + break; } return result; }