Replace strcpy with strncpy 73/239473/1 accepted/tizen/unified/20200730.063254 submit/tizen/20200728.015117
authorCheoleun Moon <chleun.moon@samsung.com>
Mon, 27 Jul 2020 04:51:55 +0000 (13:51 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Mon, 27 Jul 2020 04:51:58 +0000 (13:51 +0900)
Change-Id: I8cf4f94a9115d058d2eb6cf2ccb198ca498e870e

tests/tct-nsd-core.cpp

index fec5ee450c1bbe63bfa8e1182276906f8ff67fbe..628de837e69ffd177bdc012681aa7957a82ba60c 100755 (executable)
@@ -38,9 +38,9 @@ extern "C" {
 
 TEST(nsd, nsd){
        char *pszGetTCName = NULL;
-       pszGetTCName = (char*)malloc( 256 );
-       memset( pszGetTCName, 0x00, 256);
-       strcpy( pszGetTCName, "utc_nsd");
+       pszGetTCName = (char*)malloc(256);
+       memset(pszGetTCName, 0x00, 256);
+       strncpy(pszGetTCName, "utc_nsd", 255);
        int i=0, result=0;
 
        dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName);