diff --git a/bolt/runtime/hugify.cpp b/bolt/runtime/hugify.cpp --- a/bolt/runtime/hugify.cpp +++ b/bolt/runtime/hugify.cpp @@ -27,7 +27,7 @@ #ifdef MADV_HUGEPAGE /// Check whether the kernel supports THP via corresponding sysfs entry. static bool has_pagecache_thp_support() { - char buf[256] = {0}; + char buf[256]; const char *madviseStr = "always [madvise] never"; int fd = __open("/sys/kernel/mm/transparent_hugepage/enabled", @@ -35,6 +35,7 @@ if (fd < 0) return false; + memSet(buf, 0, sizeof(buf)); size_t res = __read(fd, buf, 256); if (res < 0) return false;