================ @@ -681,7 +680,7 @@ inline bool LocalAddressSpace::findFunctionName(pint_t addr, char *buf, uint16_t nameLen; char *funcName = getFuncNameFromTBTable(addr, nameLen, offset); if (funcName != NULL) { - snprintf(buf, bufLen, "%.*s", nameLen, funcName); + strncpy(buf, funcName, nameLen < bufLen ? nameLen : bufLen); ---------------- arichardson wrote:
This will always write up to 512 '\0' bytes. maybe best to use memcpy+strlen instead? https://github.com/llvm/llvm-project/pull/72040 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits