mirror of
https://github.com/pocoproject/poco.git
synced 2025-12-10 09:44:35 +01:00
fix(Foundation): Poco::icompare(str, pos, ptr) out of bounds error if pos > str.size() #4866
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user