Skip to content

Commit c3e6efb

Browse files
committed
fix MSAN
1 parent 29b2d1b commit c3e6efb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎Objects/mimalloc/prim/unix/prim.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static bool unix_detect_overcommit(void) {
124124
#if defined(__linux__)
125125
int fd = mi_prim_open("/proc/sys/vm/overcommit_memory", O_RDONLY);
126126
if (fd >= 0) {
127-
char buf[32];
127+
char buf[32] = {0};
128128
ssize_t nread = mi_prim_read(fd, &buf, sizeof(buf));
129129
mi_prim_close(fd);
130130
// <https://www.kernel.org/doc/Documentation/vm/overcommit-accounting>

‎Objects/mimalloc/random.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ uintptr_t _mi_os_random_weak(uintptr_t extra_seed) {
178178
}
179179

180180
static void mi_random_init_ex(mi_random_ctx_t* ctx, bool use_weak) {
181-
uint8_t key[32];
181+
uint8_t key[32] = {0};
182182
if (use_weak || !_mi_prim_random_buf(key, sizeof(key))) {
183183
// if we fail to get random data from the OS, we fall back to a
184184
// weak random source based on the current time

0 commit comments

Comments
 (0)