Skip to content

Commit f4a491f

Browse files
committed
SGX: zero-initialize reserved memory in os_mmap after allocation
1 parent 3f4145e commit f4a491f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

core/shared/platform/linux-sgx/sgx_platform.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
161161
return NULL;
162162
}
163163

164+
memset(ret, 0, aligned_size);
165+
164166
if (prot & MMAP_PROT_READ)
165167
mprot |= SGX_PROT_READ;
166168
if (prot & MMAP_PROT_WRITE)

0 commit comments

Comments
 (0)