[Lldb-commits] [PATCH] D16128: Fix TestProcessLaunch.test_environment_with_special_char for Python 3
Adrian McCarthy via lldb-commits
lldb-commits at lists.llvm.org
Tue Jan 12 16:53:41 PST 2016
amccarth accepted this revision.
amccarth added a comment.
This revision is now accepted and ready to land.
I don't know enough about SWIG to give that a thorough review.
================
Comment at: source/Host/windows/ProcessLauncherWindows.cpp:38
@@ +37,3 @@
+ cur_entry += strlen(cur_entry) + sizeof(char);
+ }
+}
----------------
I would explicitly set
*cur_entry = '\0';
after the loop to make it clear that this is a null-terminated block of null-terminated strings.
I get that buffer.resize(bytes) is going to zero out the bytes initially, _if_ it grows, so it's not technically necessary in the current use case. But if a future caller calls it with a junk buffer that's already long enough (or longer), then you could end up with a non-zero in that last byte.
http://reviews.llvm.org/D16128
More information about the lldb-commits
mailing list