malloc: Assure that THP mode is always null terminated

This commit is contained in:
Adhemerval Zanella 2023-04-12 09:36:54 -03:00
parent decf02d382
commit 801deb07f6

View File

@ -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)