From 89a0e3f223fbe4811bdcb895803fcda74b4e96fe Mon Sep 17 00:00:00 2001 From: Rot127 Date: Thu, 5 Sep 2024 08:40:40 -0500 Subject: [PATCH] Replace strcpy with strncpy. --- arch/XCore/XCoreInstPrinter.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/XCore/XCoreInstPrinter.c b/arch/XCore/XCoreInstPrinter.c index 912c12620e..3724387c9f 100644 --- a/arch/XCore/XCoreInstPrinter.c +++ b/arch/XCore/XCoreInstPrinter.c @@ -16,11 +16,6 @@ #ifdef CAPSTONE_HAS_XCORE -#ifdef _MSC_VER -#pragma warning(disable : 4996) // disable MSVC's warning on strcpy() -#pragma warning(disable : 28719) // disable MSVC's warning on strcpy() -#endif - #include #include #include @@ -51,7 +46,7 @@ void XCore_insn_extract(MCInst *MI, const char *code) char *p, *p2; char tmp[128]; - strcpy(tmp, code); // safe because code is way shorter than 128 bytes + strncpy(tmp, code, sizeof(tmp) - 1); // safe because code is way shorter than 128 bytes // find the first space p = strchr(tmp, ' ');