--- a/papi/src/libpfm4/lib/pfmlib_mips.c +++ b/papi/src/libpfm4/lib/pfmlib_mips.c @@ -144,7 +144,7 @@ pfm_mips_detect(void *this) if (strstr(buffer,"MIPS") == NULL) return PFM_ERR_NOTSUPP; - strncpy(pfm_mips_cfg.model,buffer,strlen(buffer)); + strlcpy(pfm_mips_cfg.model,buffer,sizeof(pfm_mips_cfg.model)); /* ret = pfmlib_getcpuinfo_attr("CPU implementer", buffer, sizeof(buffer)); if (ret == -1)