8076475: Misuses of strncpy/strncat

Various small fixes around strncpy and strncat

Reviewed-by: dsamersoff, coleenp
This commit is contained in:
Thomas Stuefe 2015-04-07 14:19:03 +02:00
parent 137a04308f
commit c034b74806
12 changed files with 56 additions and 52 deletions

View file

@ -172,7 +172,8 @@ class CompilerCounters : public CHeapObj<mtCompiler> {
// these methods should be called in a thread safe context
void set_current_method(const char* method) {
strncpy(_current_method, method, (size_t)cmname_buffer_length);
strncpy(_current_method, method, (size_t)cmname_buffer_length-1);
_current_method[cmname_buffer_length-1] = '\0';
if (UsePerfData) _perf_current_method->set_value(method);
}