Skip to content

Commit 5a02d64

Browse files
authored
Fix: correct size for raw data read bounds checking (#4797)
1 parent cf96d80 commit 5a02d64

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Export/Classes/Dat64File.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ local dataTypes = {
4545
String = {
4646
size = 8,
4747
read = function(b, o, d)
48-
if o > #b - 3 then return "<no offset>" end
48+
if o > #b - 7 then return "<no offset>" end
4949
local stro = bytesToULong(b, o)
50-
if stro > #b - 3 then return "<bad offset>" end
50+
if stro > #b - 7 then return "<bad offset>" end
5151
return convertUTF16to8(b, d + stro)
5252
end,
5353
},
@@ -71,7 +71,7 @@ local dataTypes = {
7171
size = 16,
7272
ref = true,
7373
read = function(b, o, d)
74-
if o > #b - 7 then return 1337 end
74+
if o > #b - 15 then return 1337 end
7575
return bytesToULong(b, o)
7676
end,
7777
},

0 commit comments

Comments
 (0)