mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Prevented a potential endless loop in StringUtil::replace()
This commit is contained in:
parent
b638a99704
commit
de48b69760
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue