[libc-commits] [PATCH] D148844: [libc] Add null-terminator to the thread name obtained from the syscall.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 20 14:34:02 PDT 2023


sivachandra created this revision.
sivachandra added a reviewer: michaelrj.
Herald added subscribers: libc-commits, ecnelises, tschuett, kristof.beyls.
Herald added projects: libc-project, All.
sivachandra requested review of this revision.

This bug was caught by the aarch64 full build builder.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148844

Files:
  libc/src/__support/threads/linux/thread.cpp


Index: libc/src/__support/threads/linux/thread.cpp
===================================================================
--- libc/src/__support/threads/linux/thread.cpp
+++ libc/src/__support/threads/linux/thread.cpp
@@ -385,7 +385,7 @@
     name_buffer[retval - 1] = '\0';
   else
     name_buffer[retval] = '\0';
-  name << name_buffer;
+  name << name_buffer << cpp::StringStream::ENDS;
   return 0;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148844.515489.patch
Type: text/x-patch
Size: 406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230420/08dc1122/attachment.bin>


More information about the libc-commits mailing list