Update to latest centos 7 prereqs image (#46422)
authorAdeel Mujahid <3840695+am11@users.noreply.github.com>
Mon, 4 Jan 2021 16:35:36 +0000 (18:35 +0200)
committerGitHub <noreply@github.com>
Mon, 4 Jan 2021 16:35:36 +0000 (17:35 +0100)
* 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.
      |                  ~~~~~~^~~~~~
```

eng/pipelines/common/platform-matrix.yml
src/tests/Interop/BestFitMapping/BestFitMappingNative.cpp

index 4a9b694..97268ab 100644 (file)
@@ -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 }}
index 9cbec37..d75621a 100644 (file)
@@ -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;
 }