Fix out-of-bounds access in memscan.field_offset()

Fixes #1907
develop
lethosor 2021-08-10 11:26:06 -04:00
parent 0140ace317
commit e8d9a9d184
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 1 additions and 1 deletions

@ -310,7 +310,7 @@ function field_ref(handle,...)
end
function field_offset(type,...)
local tmp = df.new('intptr_t') -- pointer to nullptr
local tmp = df.new('int8_t', df.sizeof(type))
local _, haddr = df.sizeof(tmp)
local handle = df.reinterpret_cast(type, tmp)
local _, addr = df.sizeof(field_ref(handle,...))