break;
case WIFI_AWARE_SECURITY_TYPE_PSK:
printf("PSK\n");
- ret = wifi_aware_data_path_set_psk(g_ndp, PSK);
+ wifi_aware_data_path_set_psk(g_ndp, PSK);
break;
case WIFI_AWARE_SECURITY_TYPE_PMK:
printf("PMK\n");
clear_resources();
g_sub_type = WIFI_AWARE_SUBSCRIBE_TYPE_PASSIVE;
g_security_type = WIFI_AWARE_SECURITY_TYPE_PSK;
- strncpy(g_psk, PSK, strlen(PSK));
+ strncpy(g_psk, PSK, MAX_PSK_LEN);
+ g_psk[MAX_PSK_LEN] = '\0';
run_common();
}
clear_resources();
g_sub_type = WIFI_AWARE_SUBSCRIBE_TYPE_ACTIVE;
g_security_type = WIFI_AWARE_SECURITY_TYPE_PSK;
- strncpy(g_psk, PSK, strlen(PSK));
+ strncpy(g_psk, PSK, MAX_PSK_LEN);
+ g_psk[MAX_PSK_LEN] = '\0';
run_common();
}
clear_resources();
g_sub_type = WIFI_AWARE_SUBSCRIBE_TYPE_PASSIVE;
g_security_type = WIFI_AWARE_SECURITY_TYPE_PSK;
- strncpy(g_psk, WRONG_PSK, strlen(WRONG_PSK));
+ strncpy(g_psk, WRONG_PSK, MAX_PSK_LEN);
+ g_psk[MAX_PSK_LEN] = '\0';
run_common();
}
clear_resources();
g_sub_type = WIFI_AWARE_SUBSCRIBE_TYPE_ACTIVE;
g_security_type = WIFI_AWARE_SECURITY_TYPE_PSK;
- strncpy(g_psk, WRONG_PSK, strlen(WRONG_PSK));
+ strncpy(g_psk, WRONG_PSK, MAX_PSK_LEN);
+ g_psk[MAX_PSK_LEN] = '\0';
run_common();
}