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

Unified Diff: src/gdb-jit.cc

Issue 7289013: Fix presubmit failure in gdb-jit.cc. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gdb-jit.cc
diff --git a/src/gdb-jit.cc b/src/gdb-jit.cc
index 4ab33c43775ee6c6360e883ef56e17df732b4a66..4d57e254609848372afa31633ea2ae5cba2790e0 100644
--- a/src/gdb-jit.cc
+++ b/src/gdb-jit.cc
@@ -267,12 +267,12 @@ class MachOSection : public DebugSectionBase<MachOSectionHeader> {
header->flags = flags_;
header->reserved1 = 0;
header->reserved2 = 0;
- memset(header->sectname, 0, 16);
- memset(header->segname, 0, 16);
- ASSERT(strlen(name_) < 16);
- ASSERT(strlen(segment_) < 16);
- strcpy(header->sectname, name_);
- strcpy(header->segname, segment_);
+ memset(header->sectname, 0, sizeof(header->sectname));
+ memset(header->segname, 0, sizeof(header->segname));
+ ASSERT(strlen(name_) < sizeof(header->sectname));
+ ASSERT(strlen(segment_) < sizeof(header->segname));
+ strncpy(header->sectname, name_, sizeof(header->sectname));
+ strncpy(header->segname, segment_, sizeof(header->segname));
}
private:
@@ -295,7 +295,7 @@ struct ELFSectionHeader {
uintptr_t alignment;
uintptr_t entry_size;
};
-
+
#if defined(__ELF)
class ELFSection : public DebugSectionBase<ELFSectionHeader> {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698