[PATCH] D42828: Fix for read-past-end-of-array buglet in ProcessElfCore.cpp while reading linux notes

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 14:52:06 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL324156: Fix a copy of a fixed length, possibly non-nul terminated, string (authored by jmolenda, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42828?vs=132500&id=132688#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42828

Files:
  lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp


Index: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -665,7 +665,7 @@
       Status status = prpsinfo.Parse(note.data, arch);
       if (status.Fail())
         return status.ToError();
-      thread_data.name = prpsinfo.pr_fname;
+      thread_data.name.assign (prpsinfo.pr_fname, strnlen (prpsinfo.pr_fname, sizeof (prpsinfo.pr_fname)));
       SetID(prpsinfo.pr_pid);
       break;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42828.132688.patch
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180202/cd6b1809/attachment.bin>


More information about the llvm-commits mailing list