[libc-commits] [PATCH] D148871: [libc] Another fix to add a null-terminator to the pthread name.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 20 20:31:28 PDT 2023


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

This fix is similar to the one done in https://reviews.llvm.org/D148844.
This miss was caught by the risv64 builder.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148871

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
@@ -358,7 +358,7 @@
     int retval = __llvm_libc::syscall_impl(SYS_prctl, PR_GET_NAME, name_buffer);
     if (retval < 0)
       return -retval;
-    name << name_buffer;
+    name << name_buffer << cpp::StringStream::ENDS;
     return 0;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148871.515567.patch
Type: text/x-patch
Size: 462 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230421/20889490/attachment-0001.bin>


More information about the libc-commits mailing list