From 801deb07f6ecc6a3c8933cffc23d4b3a895259e1 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 12 Apr 2023 09:36:54 -0300 Subject: malloc: Assure that THP mode is always null terminated --- sysdeps/unix/sysv/linux/malloc-hugepages.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/sysv/linux/malloc-hugepages.c b/sysdeps/unix/sysv/linux/malloc-hugepages.c index 683d68c327..740027ebfb 100644 --- a/sysdeps/unix/sysv/linux/malloc-hugepages.c +++ b/sysdeps/unix/sysv/linux/malloc-hugepages.c @@ -61,6 +61,7 @@ __malloc_thp_mode (void) char str[sizeof(mode_always)]; ssize_t s = __read_nocancel (fd, str, sizeof (str)); + str[s] = '\0'; __close_nocancel (fd); if (s == sizeof (mode_always) - 1) -- cgit 1.4.1