mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +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
|
@ -159,7 +159,12 @@ lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
strncpy(newlib->name, libname, sizeof(newlib->name));
|
||||
if (strlen(libname) >= sizeof(newlib->name)) {
|
||||
print_debug("libname %s too long\n", libname);
|
||||
return NULL;
|
||||
}
|
||||
strcpy(newlib->name, libname);
|
||||
|
||||
newlib->base = base;
|
||||
|
||||
if (fd == -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue