aboutsummaryrefslogtreecommitdiffstats
path: root/src/fst
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-07-18 16:28:38 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-18 16:28:38 (GMT)
commit9c68b6af971e82621734f495c1ba9af490a37d0e (patch)
tree6a3269f44645df55bff00df833784eb2770340ae /src/fst
parent7ba240b90fb9e360fc87dfb77c6e28f82bfa4509 (diff)
downloadhostap-9c68b6af971e82621734f495c1ba9af490a37d0e.zip
hostap-9c68b6af971e82621734f495c1ba9af490a37d0e.tar.gz
hostap-9c68b6af971e82621734f495c1ba9af490a37d0e.tar.bz2
FST: Fix FST-MANAGER TEST_REQUEST parsing
The space separator between the command and the parameter was not skipped properly and the first integer ended up being interpreted as 0 in all cases. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/fst')
-rw-r--r--src/fst/fst_session.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/fst/fst_session.c b/src/fst/fst_session.c
index 2f42b12..94122fd 100644
--- a/src/fst/fst_session.c
+++ b/src/fst/fst_session.c
@@ -1359,6 +1359,9 @@ int fst_test_req_send_fst_request(const char *params)
u8 channel;
char additional_param[FST_MAX_COMMAND_WORD_NAME_LENGTH];
+ if (params[0] != ' ')
+ return -EINVAL;
+ params++;
fsts_id = fst_read_next_int_param(params, &is_valid, &endp);
if (!is_valid)
return -EINVAL;
@@ -1410,6 +1413,9 @@ int fst_test_req_send_fst_response(const char *params)
char response[FST_MAX_COMMAND_WORD_NAME_LENGTH];
struct fst_session *_s;
+ if (params[0] != ' ')
+ return -EINVAL;
+ params++;
fsts_id = fst_read_next_int_param(params, &is_valid, &endp);
if (!is_valid)
return -EINVAL;
@@ -1476,6 +1482,9 @@ int fst_test_req_send_ack_request(const char *params)
struct fst_session s;
struct fst_group *g;
+ if (params[0] != ' ')
+ return -EINVAL;
+ params++;
fsts_id = fst_read_next_int_param(params, &is_valid, &endp);
if (!is_valid)
return -EINVAL;
@@ -1501,6 +1510,9 @@ int fst_test_req_send_ack_response(const char *params)
struct fst_session s;
struct fst_group *g;
+ if (params[0] != ' ')
+ return -EINVAL;
+ params++;
fsts_id = fst_read_next_int_param(params, &is_valid, &endp);
if (!is_valid)
return -EINVAL;
@@ -1526,6 +1538,9 @@ int fst_test_req_send_tear_down(const char *params)
struct fst_session s;
struct fst_group *g;
+ if (params[0] != ' ')
+ return -EINVAL;
+ params++;
fsts_id = fst_read_next_int_param(params, &is_valid, &endp);
if (!is_valid)
return -EINVAL;
@@ -1548,6 +1563,9 @@ u32 fst_test_req_get_fsts_id(const char *params)
char *endp;
struct fst_session *s;
+ if (params[0] != ' ')
+ return FST_FSTS_ID_NOT_FOUND;
+ params++;
sid = fst_read_next_int_param(params, &is_valid, &endp);
if (!is_valid)
return FST_FSTS_ID_NOT_FOUND;
@@ -1567,6 +1585,9 @@ int fst_test_req_get_local_mbies(const char *request, char *buf, size_t buflen)
struct fst_group *g;
struct fst_iface *iface;
+ if (request[0] != ' ')
+ return -EINVAL;
+ request++;
if (fst_read_next_text_param(request, ifname, sizeof(ifname), &endp) ||
!*ifname)
goto problem;