diff --git a/p2p.c b/p2p.c index d01ba20..ad08254 100644 --- a/p2p.c +++ b/p2p.c @@ -2480,8 +2480,8 @@ static int nfc_wps_read_passwd(struct sigma_dut *dut, run_system(dut, "killall wps-nfc.py"); run_system(dut, "killall p2p-nfc.py"); - if ((ssid && strlen(ssid) >= 2 * sizeof(ssid_hex)) || - (passphrase && strlen(passphrase) >= 2 * sizeof(passphrase_hex))) { + if ((ssid && 2 * strlen(ssid) >= sizeof(ssid_hex)) || + (passphrase && 2 * strlen(passphrase) >= sizeof(passphrase_hex))) { send_resp(dut, conn, SIGMA_ERROR, "ErrorCode,Too long SSID/passphrase"); return 0; diff --git a/sta.c b/sta.c index e2ca2d6..1fe54ef 100644 --- a/sta.c +++ b/sta.c @@ -8412,8 +8412,8 @@ static int cmd_sta_er_config(struct sigma_dut *dut, struct sigma_conn *conn, return 0; } - if (strlen(ssid) >= 2 * sizeof(ssid_hex) || - strlen(passphrase) >= 2 * sizeof(passphrase_hex)) { + if (2 * strlen(ssid) >= sizeof(ssid_hex) || + 2 * strlen(passphrase) >= sizeof(passphrase_hex)) { send_resp(dut, conn, SIGMA_ERROR, "ErrorCode,Too long SSID/passphrase"); return 0;