mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-24 05:14:52 +02:00
8076475: Misuses of strncpy/strncat
Various small fixes around strncpy and strncat Reviewed-by: dsamersoff, coleenp
This commit is contained in:
parent
137a04308f
commit
c034b74806
12 changed files with 56 additions and 52 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue