Skip to content

Commit 9c4d52e

Browse files
committed
Fix bound checking in NativeEraser
Fix yck1509#433
1 parent 181bbed commit 9c4d52e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Confuser.Core/NativeEraser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static void Erase(List<Tuple<uint, uint, byte[]>> sections, IFileSection s) {
3131

3232
static void Erase(List<Tuple<uint, uint, byte[]>> sections, uint methodOffset) {
3333
foreach (var sect in sections)
34-
if (methodOffset >= sect.Item1) {
34+
if (methodOffset >= sect.Item1 && methodOffset - sect.Item1 < sect.Item3.Length) {
3535
uint f = sect.Item3[methodOffset - sect.Item1];
3636
uint size;
3737
switch ((f & 7)) {

0 commit comments

Comments
 (0)