未验证 提交 c7c39316 编写于 作者: E Egor Bogatov 提交者: GitHub

Fix strnstr (#74421)

上级 0a5ca9fa
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册