[llvm] 59715e7 - Switch to strncpy to silence GCC stringop overflow warnings.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 13 11:17:00 PDT 2023
Author: Lang Hames
Date: 2023-07-13T11:16:54-07:00
New Revision: 59715e7ff32f8500d3e23ecdcddf455f3aa7a4f1
URL: https://github.com/llvm/llvm-project/commit/59715e7ff32f8500d3e23ecdcddf455f3aa7a4f1
DIFF: https://github.com/llvm/llvm-project/commit/59715e7ff32f8500d3e23ecdcddf455f3aa7a4f1.diff
LOG: Switch to strncpy to silence GCC stringop overflow warnings.
Thanks to Simon Pilgrim for letting me know about these in
https://reviews.llvm.org/rG9d701c8a8d65.
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
index 23a992da663df8..4567b8b8cea112 100644
--- a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
@@ -1370,7 +1370,7 @@ Error MachOPlatform::MachOPlatformPlugin::populateObjCRuntimeObject(
DataSections.push_back({});
auto &SD = DataSections.back();
memset(&SD.Sec, 0, sizeof(SD.Sec));
- strcpy(SD.Sec.sectname, "__objc_imageinfo");
+ strncpy(SD.Sec.sectname, "__objc_imageinfo", 16);
strcpy(SD.Sec.segname, "__DATA");
SD.Sec.size = 8;
SD.AddFixups = [&](size_t RecordOffset) {
More information about the llvm-commits
mailing list