public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] malloc: Assure that THP mode is always null terminated
@ 2023-04-13 20:18 Adhemerval Zanella
  2023-04-14  6:52 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Adhemerval Zanella @ 2023-04-13 20:18 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=801deb07f6ecc6a3c8933cffc23d4b3a895259e1

commit 801deb07f6ecc6a3c8933cffc23d4b3a895259e1
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Apr 12 09:36:54 2023 -0300

    malloc: Assure that THP mode is always null terminated

Diff:
---
 sysdeps/unix/sysv/linux/malloc-hugepages.c | 1 +
 1 file changed, 1 insertion(+)

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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-14 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 20:18 [glibc] malloc: Assure that THP mode is always null terminated Adhemerval Zanella
2023-04-14  6:52 ` Andreas Schwab
2023-04-14 11:02   ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).