mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
P2PS: Fix P2P_FIND seek parameter parsing
Only the first seek=<service name> parameter was accepted from the P2P_FIND command. Fix this to go through all seek parameters to construct the list of service hash values to seek. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
83e520e473
commit
129b621653
@ -4597,16 +4597,20 @@ static int p2p_ctrl_find(struct wpa_supplicant *wpa_s, char *cmd)
|
|||||||
|
|
||||||
/* Must be searched for last, because it adds nul termination */
|
/* Must be searched for last, because it adds nul termination */
|
||||||
pos = os_strstr(cmd, " seek=");
|
pos = os_strstr(cmd, " seek=");
|
||||||
|
if (pos)
|
||||||
|
pos += 6;
|
||||||
while (pos && seek_count < P2P_MAX_QUERY_HASH + 1) {
|
while (pos && seek_count < P2P_MAX_QUERY_HASH + 1) {
|
||||||
char *term;
|
char *term;
|
||||||
|
|
||||||
term = os_strchr(pos + 1, ' ');
|
_seek[seek_count++] = pos;
|
||||||
_seek[seek_count++] = pos + 6;
|
|
||||||
seek = _seek;
|
seek = _seek;
|
||||||
pos = os_strstr(pos + 6, " seek=");
|
term = os_strchr(pos, ' ');
|
||||||
|
if (!term)
|
||||||
if (term)
|
break;
|
||||||
*term = '\0';
|
*term = '\0';
|
||||||
|
pos = os_strstr(term + 1, "seek=");
|
||||||
|
if (pos)
|
||||||
|
pos += 5;
|
||||||
}
|
}
|
||||||
if (seek_count > P2P_MAX_QUERY_HASH) {
|
if (seek_count > P2P_MAX_QUERY_HASH) {
|
||||||
seek[0] = NULL;
|
seek[0] = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user