From 167301d8bcafdd2397e644ddb975072315e1f13d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 15 Aug 2024 03:11:45 +0900 Subject: [PATCH] runtimes/native: don't reject zero-bype memory access eg. zero byte textUtf8 is ok. --- runtimes/native/src/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtimes/native/src/runtime.c b/runtimes/native/src/runtime.c index 5422ae48..e710f9e6 100644 --- a/runtimes/native/src/runtime.c +++ b/runtimes/native/src/runtime.c @@ -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(); } }