Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Unified Diff: src/libplatform/tracing/trace-object.cc

Issue 2232683002: [Tracing] Minor bugs fix. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/libplatform/tracing/trace-writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libplatform/tracing/trace-object.cc
diff --git a/src/libplatform/tracing/trace-object.cc b/src/libplatform/tracing/trace-object.cc
index f8ad9f9f7d49a5ea0851513dad0d2453ccc6fba0..e16d174d35752023d0a0138d9a3c32e0aa98200f 100644
--- a/src/libplatform/tracing/trace-object.cc
+++ b/src/libplatform/tracing/trace-object.cc
@@ -24,9 +24,10 @@ V8_INLINE static void CopyTraceObjectParameter(char** buffer,
const char** member,
const char* end) {
if (*member) {
- strncpy(*buffer, *member, end - *buffer);
+ size_t length = strlen(*member) + 1;
+ strncpy(*buffer, *member, length);
mattloring 2016/08/10 00:41:54 How does this behave when there is not enough spac
*member = *buffer;
- *buffer += strlen(*member) + 1;
+ *buffer += length;
}
}
« no previous file with comments | « no previous file | src/libplatform/tracing/trace-writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698