fix(Foundation): Poco::icompare(str, pos, ptr) out of bounds error if pos > str.size() #4866

This commit is contained in:
Günter Obiltschnig
2025-02-08 14:54:18 +01:00
parent 7bac48ff1a
commit 4b55efdcf3

View File

@@ -400,7 +400,8 @@ int icompare(
typename S::size_type pos,
const typename S::value_type* ptr)
{
return icompare(str, pos, str.size() - pos, ptr);
int n = pos < str.size() ? str.size() - pos : 0;
return icompare(str, pos, n, ptr);
}