Skip to content

Commit

Permalink
Thanks to pedasmith for pointing that bug out!
Browse files Browse the repository at this point in the history
  • Loading branch information
gro-ove committed Mar 12, 2019
1 parent d3edd20 commit 4ea9519
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions AcTools/Utils/Helpers/Utf8Checker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static bool IsValid(byte[] buffer, int position, int length, ref int byt
}

if (ch >= 0xc2 && ch <= 0xdf) {
if (position >= length - 2) {
if (position > length - 2) {
bytes = 0;
return false;
}
Expand All @@ -50,7 +50,7 @@ private static bool IsValid(byte[] buffer, int position, int length, ref int byt
}

if (ch == 0xe0) {
if (position >= length - 3) {
if (position > length - 3) {
bytes = 0;
return false;
}
Expand All @@ -66,7 +66,7 @@ private static bool IsValid(byte[] buffer, int position, int length, ref int byt


if (ch >= 0xe1 && ch <= 0xef) {
if (position >= length - 3) {
if (position > length - 3) {
bytes = 0;
return false;
}
Expand All @@ -82,7 +82,7 @@ private static bool IsValid(byte[] buffer, int position, int length, ref int byt
}

if (ch == 0xf0) {
if (position >= length - 4) {
if (position > length - 4) {
bytes = 0;
return false;
}
Expand All @@ -99,7 +99,7 @@ private static bool IsValid(byte[] buffer, int position, int length, ref int byt
}

if (ch == 0xf4) {
if (position >= length - 4) {
if (position > length - 4) {
bytes = 0;
return false;
}
Expand All @@ -116,7 +116,7 @@ private static bool IsValid(byte[] buffer, int position, int length, ref int byt
}

if (ch >= 0xf1 && ch <= 0xf3) {
if (position >= length - 4) {
if (position > length - 4) {
bytes = 0;
return false;
}
Expand Down

0 comments on commit 4ea9519

Please sign in to comment.