From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Mon, 4 Jan 2021 16:35:36 +0000 (+0200) Subject: Update to latest centos 7 prereqs image (#46422) X-Git-Tag: submit/tizen/20210909.063632~3972 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=649a02efa27a6c29245609bdbf46a6a789bf4d03;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Update to latest centos 7 prereqs image (#46422) * Update to latest centos 7 prereqs image * Fix stringop-overflow in interop tests Warnings were of the form: ```sh /runtime/src/tests/Interop/BestFitMapping/BestFitMappingNative.cpp:94:12: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=] 94 | strncpy(pBack, pStr, len); | ~~~~~~~^~~~~~~~~~~~~~~~~~ /runtime/src/tests/Interop/BestFitMapping/BestFitMappingNative.cpp:92:24: note: length computed here 92 | size_t len = strlen(pStr) + 1; //+1, Include the NULL Character. | ~~~~~~^~~~~~ ``` --- diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 4a9b694..97268ab 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -169,7 +169,7 @@ jobs: targetRid: linux-x64 platform: Linux_x64 container: - image: centos-7-359e48e-20200313130914 + image: centos-7-20201227183837-5fe0e50 registry: mcr jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} diff --git a/src/tests/Interop/BestFitMapping/BestFitMappingNative.cpp b/src/tests/Interop/BestFitMapping/BestFitMappingNative.cpp index 9cbec37..d75621a 100644 --- a/src/tests/Interop/BestFitMapping/BestFitMappingNative.cpp +++ b/src/tests/Interop/BestFitMapping/BestFitMappingNative.cpp @@ -91,7 +91,7 @@ extern "C" DLL_EXPORT LPSTR __cdecl CLPStr_In(LPSTR pStr) //alloc,copy, since we cannot depend the Marshaler's activity. size_t len = strlen(pStr) + 1; //+1, Include the NULL Character. LPSTR pBack = (LPSTR)CoreClrAlloc(sizeof(char) * len); - strncpy(pBack, pStr, len); + strcpy(pBack, pStr); return pBack; } @@ -119,7 +119,7 @@ extern "C" DLL_EXPORT LPSTR __cdecl CLPStr_InOut(LPSTR pStr) //alloc,copy, since we cannot depend the Marshaler's activity. size_t len = strlen(pStr) + 1; //+1, Include the NULL Character. LPSTR pBack = (LPSTR)CoreClrAlloc(len); - strncpy(pBack, pStr, len); + strcpy(pBack, pStr); return pBack; } @@ -135,7 +135,7 @@ extern "C" DLL_EXPORT LPSTR __cdecl CLPStr_InByRef(LPSTR* ppStr) //alloc,copy, since we cannot depend the Marshaler's activity. size_t len = strlen(*ppStr) + 1; //+1, Include the NULL Character. LPSTR pBack = (LPSTR)CoreClrAlloc(len); - strncpy(pBack, *ppStr, len); + strcpy(pBack, *ppStr); return pBack; } @@ -163,7 +163,7 @@ extern "C" DLL_EXPORT LPSTR __cdecl CLPStr_InOutByRef(LPSTR* ppStr) //alloc,copy, since we cannot depend the Marshaler's activity. size_t len = strlen(*ppStr) + 1; //+1, Include the NULL Character. LPSTR pBack = (LPSTR)CoreClrAlloc(len); - strncpy(pBack, *ppStr, len); + strcpy(pBack, *ppStr); return pBack; } @@ -187,7 +187,7 @@ extern "C" DLL_EXPORT LPSTR STDMETHODCALLTYPE SLPStr_In(LPSTR pStr) //alloc,copy, since we cannot depend the Marshaler's activity. size_t len = strlen(pStr) + 1; //+1, Include the NULL Character. LPSTR pBack = (LPSTR)CoreClrAlloc(len); - strncpy(pBack, pStr, len); + strcpy(pBack, pStr); return pBack; } @@ -213,7 +213,7 @@ extern "C" DLL_EXPORT LPSTR STDMETHODCALLTYPE SLPStr_InOut(LPSTR pStr) //alloc,copy, since we cannot depend the Marshaler's activity. size_t len = strlen(pStr) + 1; //+1, Include the NULL Character. LPSTR pBack = (LPSTR)CoreClrAlloc(len); - strncpy(pBack, pStr, len); + strcpy(pBack, pStr); return pBack; } @@ -227,7 +227,7 @@ extern "C" DLL_EXPORT LPSTR STDMETHODCALLTYPE SLPStr_InByRef(LPSTR* ppStr) //alloc,copy, since we cannot depend the Marshaler's activity. size_t len = strlen(*ppStr) + 1; //+1, Include the NULL Character. LPSTR pBack = (LPSTR)CoreClrAlloc(len); - strncpy(pBack, *ppStr, len); + strcpy(pBack, *ppStr); return pBack; } @@ -255,7 +255,7 @@ extern "C" DLL_EXPORT LPSTR STDMETHODCALLTYPE SLPStr_InOutByRef(LPSTR* ppStr) //alloc,copy, since we cannot depend the Marshaler's activity. size_t len = strlen(*ppStr) + 1; //+1, Include the NULL Character. LPSTR pBack = (LPSTR)CoreClrAlloc(len); - strncpy(pBack, *ppStr, len); + strcpy(pBack, *ppStr); return pBack; }