8030763: Validate global memory allocation

Add length checks where necessary

Reviewed-by: coleenp, mschoene
This commit is contained in:
Harold Seigel 2014-07-14 12:43:50 +04:00
parent 5323c1c179
commit 7ec22758dc
7 changed files with 11 additions and 30 deletions

View file

@ -2123,6 +2123,7 @@ void CompileBroker::set_last_compile(CompilerThread* thread, methodHandle method
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;