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

@ -300,6 +300,7 @@ address decode_env::handle_event(const char* event, address arg) {
strlen((const char*)arg) > sizeof(buffer) - 1) {
// Only print this when the mach changes
strncpy(buffer, (const char*)arg, sizeof(buffer) - 1);
buffer[sizeof(buffer) - 1] = '\0';
output()->print_cr("[Disassembling for mach='%s']", arg);
}
} else if (match(event, "format bytes-per-line")) {