1.1 --- a/agent/src/os/bsd/libproc_impl.c Wed Oct 14 16:43:13 2020 +0800 1.2 +++ b/agent/src/os/bsd/libproc_impl.c Wed Oct 14 17:44:48 2020 +0800 1.3 @@ -215,7 +215,12 @@ 1.4 return NULL; 1.5 } 1.6 1.7 - strncpy(newlib->name, libname, sizeof(newlib->name)); 1.8 + if (strlen(libname) >= sizeof(newlib->name)) { 1.9 + print_debug("libname %s too long\n", libname); 1.10 + return NULL; 1.11 + } 1.12 + strcpy(newlib->name, libname); 1.13 + 1.14 newlib->base = base; 1.15 1.16 if (fd == -1) {