Skip to content

Commit

Permalink
runtimes/native: don't reject zero-bype memory access
Browse files Browse the repository at this point in the history
eg. zero byte textUtf8 is ok.
  • Loading branch information
yamt committed Aug 14, 2024
1 parent 9ac37b6 commit 167301d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtimes/native/src/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void bounds_check(const void *sp, size_t sz)
const void *memory_sp = (const void *)memory;
const void *memory_ep = (const uint8_t *)memory_sp + (1 << 16);
const void *ep = (const uint8_t *)sp + sz;
if (ep <= sp || sp < memory_sp || memory_ep < ep) {
if (ep < sp || sp < memory_sp || memory_ep < ep) {
out_of_bounds_access();
}
}
Expand Down

0 comments on commit 167301d

Please sign in to comment.