labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks good, just make sure to not include extra \0 bytes.

Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:668
         return status.ToError();
- = prpsinfo.pr_fname;
+ (prpsinfo.pr_fname, sizeof (prpsinfo.pr_fname));
In case the name *is* null-terminated, this will forcibly include the \0 bytes 
into the string, which is not good.
I think this should be something like `assign(pr_fname, strnlen(pr_fname, 
sizeof(pf_fname))` (maybe there is a more c++-y way of writing that, but I 
couldn't think of one).

I think adding a check for the thread name in the test still has value (asan 
will just check we don't do anything stupid, but it won't verify we actually 
produce the right name in the end), but I can do that as a follow-up.


lldb-commits mailing list

Reply via email to