From: Adhemerval Zanella Date: Wed, 12 Apr 2023 12:36:54 +0000 (-0300) Subject: malloc: Assure that THP mode is always null terminated X-Git-Tag: glibc-2.38~375 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=801deb07f6ecc6a3c8933cffc23d4b3a895259e1;p=thirdparty%2Fglibc.git malloc: Assure that THP mode is always null terminated --- diff --git a/sysdeps/unix/sysv/linux/malloc-hugepages.c b/sysdeps/unix/sysv/linux/malloc-hugepages.c index 683d68c3275..740027ebfb0 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)