Skip to content

Commit

Permalink
Validate 5 GHz channel in P2P commands
Browse files Browse the repository at this point in the history
This commit fixes static analysis taint issues.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
  • Loading branch information
PradeepPotteti1 authored and jmalinen committed Oct 25, 2016
1 parent d31d132 commit 8086d18
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,13 @@ static int cmd_sta_start_autonomous_go(struct sigma_dut *dut,
freq = 2407 + chan * 5;
else if (chan == 14)
freq = 2484;
else
else if (chan >= 36 && chan <= 165)
freq = 5000 + chan * 5;
else {
sigma_dut_print(dut, DUT_MSG_ERROR,
"Invalid channel: %d", chan);
return -1;
}

if (ssid_param)
snprintf(buf, sizeof(buf), "P2P_SET ssid_postfix %s",
Expand Down Expand Up @@ -1077,8 +1082,13 @@ static int cmd_sta_p2p_start_group_formation(struct sigma_dut *dut,
freq = 2407 + chan * 5;
else if (chan == 14)
freq = 2484;
else
else if (chan >= 36 && chan <= 165)
freq = 5000 + chan * 5;
else {
sigma_dut_print(dut, DUT_MSG_ERROR,
"Invalid channel: %d", chan);
return -1;
}
}

if (dut->wps_method == WFA_CS_WPS_NOT_READY) {
Expand Down

0 comments on commit 8086d18

Please sign in to comment.