Index: test/cctest/test-debug.cc |
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc |
index d03785056d385f6f901e6ef6f2aa20070931ecf7..b69ecccd6b791aeea40694d47368e47b7605f929 100644 |
--- a/test/cctest/test-debug.cc |
+++ b/test/cctest/test-debug.cc |
@@ -2202,8 +2202,9 @@ bool GetEvaluateStringResult(char *message, char* buffer, int buffer_size) { |
if (pos == NULL) { |
return false; |
} |
- Vector<char> buf(buffer, buffer_size - 1); |
- OS::StrNCpy(buf, pos, buffer_size); |
+ Vector<char> buf(buffer, buffer_size); |
+ OS::StrNCpy(buf, pos, buffer_size - 1); |
+ buffer[buffer_size - 1] = '\0'; |
return true; |
} |