Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update jitconfig.cpp
  • Loading branch information
EgorBo authored Aug 23, 2022
commit 2c0836dd79f0f19f787fb6de3d3d4f7837fd301d
5 changes: 5 additions & 0 deletions src/coreclr/jit/jitconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ void JitConfigValues::MethodSet::destroy(ICorJitHost* host)
// strstr that is length-limited, this implementation is not intended to be used on hot paths
static size_t strnstr(const char* pSrc, size_t srcSize, const char* needle, size_t needleSize)
{
if (srcSize < needleSize)
{
return -1;
}

for (size_t srcPos = 0; srcPos <= srcSize - needleSize; srcPos++)
{
if (strncmp(pSrc + srcPos, needle, needleSize) == 0)
Expand Down