Use length of strncpy as size of destination
authorCheoleun Moon <chleun.moon@samsung.com>
Thu, 9 Apr 2020 10:15:52 +0000 (19:15 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Thu, 9 Apr 2020 10:15:52 +0000 (19:15 +0900)
cts-verifier/cts-verifier-subscribe-test.c

index ae0fd2f..d31aeea 100644 (file)
@@ -310,7 +310,7 @@ void test_psk_passive()
        test_init();
        g_sub_type = WIFI_AWARE_SUBSCRIBE_TYPE_PASSIVE;
        g_security_type = WIFI_AWARE_SECURITY_TYPE_PSK;
-       strncpy(g_psk, PASSPHRASE, strlen(PASSPHRASE));
+       strncpy(g_psk, PASSPHRASE, MAX_PSK_LEN);
        run_common();
 }
 
@@ -320,6 +320,6 @@ void test_psk_active()
        test_init();
        g_sub_type = WIFI_AWARE_SUBSCRIBE_TYPE_ACTIVE;
        g_security_type = WIFI_AWARE_SECURITY_TYPE_PSK;
-       strncpy(g_psk, PASSPHRASE, strlen(PASSPHRASE));
+       strncpy(g_psk, PASSPHRASE, MAX_PSK_LEN);
        run_common();
 }