diff src/share/vm/compiler/compileBroker.cpp @ 17567:5656140324ed

8030763: Validate global memory allocation Summary: Add length checks where necessary Reviewed-by: coleenp, mschoene
author hseigel
date Thu, 13 Feb 2014 11:28:17 -0500
parents 78da3894b86f
children 3eed8712d410 364b73402247
line wrap: on
line diff
--- a/src/share/vm/compiler/compileBroker.cpp	Wed Feb 12 11:33:30 2014 -0800
+++ b/src/share/vm/compiler/compileBroker.cpp	Thu Feb 13 11:28:17 2014 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2089,6 +2089,7 @@
   ResourceMark rm;
   char* method_name = method->name()->as_C_string();
   strncpy(_last_method_compiled, method_name, CompileBroker::name_buffer_length);
+  _last_method_compiled[CompileBroker::name_buffer_length - 1] = '\0'; // ensure null terminated
   char current_method[CompilerCounters::cmname_buffer_length];
   size_t maxLen = CompilerCounters::cmname_buffer_length;