Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…o chakra_nuget
  • Loading branch information
pre10der89 committed Jan 5, 2017
2 parents bfec5a6 + 71a87b0 commit 6432af3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/Common/Codex/Utf8Codex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,9 @@ namespace utf8
LSlowPath:
while (cch-- > 0)
{
*buffer++ = Decode(ptr, ptr + 4, localOptions); // WARNING: Assume cch correct, suppress end-of-buffer checking
LPCUTF8 end = ptr + cch + 1; // WARNING: Assume cch correct, suppress end-of-buffer checking

*buffer++ = Decode(ptr, end, localOptions);
if (ShouldFastPath(ptr, buffer)) goto LFastPath;
}
}
Expand Down Expand Up @@ -466,7 +468,9 @@ namespace utf8
DecodeOptions localOptions = options;
while (cch-- > 0)
{
if (*pch++ != utf8::Decode(bch, bch + 4, localOptions)) // WARNING: Assume cch correct, suppress end-of-buffer checking
LPCUTF8 end = bch + cch + 1; // WARNING: Assume cch correct, suppress end-of-buffer checking

if (*pch++ != utf8::Decode(bch, end, localOptions))
return false;
}
return true;
Expand Down
6 changes: 5 additions & 1 deletion lib/Parser/HashFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ ULONG CaseSensitiveComputeHashCch(LPCUTF8 prgch, int32 cch)
ULONG luHash = 0;

while (cch-- > 0)
luHash = 17 * luHash + utf8::Decode(prgch, prgch + 4, options); // WARNING: Assume cch correct, suppress end-of-buffer checking
{
LPCUTF8 end = prgch + cch + 1; // WARNING: Assume cch correct, suppress end-of-buffer checking

luHash = 17 * luHash + utf8::Decode(prgch, end, options);
}
return luHash;
}

Expand Down

0 comments on commit 6432af3

Please sign in to comment.