[PATCH] P2P: Fix p2p_ctrl_invite_persistent() command processing

Jouni Malinen j
Sat Sep 15 22:25:38 PDT 2012


On Thu, Sep 13, 2012 at 10:42:14AM -0700, Dmitry Shmidt wrote:
> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> @@ -3547,6 +3541,13 @@ static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd)
>  			return -1;
>  	}
>  
> +	pos = os_strstr(cmd, " peer=");
> +	if (pos) {
> +		pos += 6;
> +		if (hwaddr_aton(pos, peer))
> +			return -1;
> +	}
> +
>  	ht40 = os_strstr(cmd, " ht40") != NULL;
>  
>  	return wpas_p2p_invite(wpa_s, pos ? peer : NULL, ssid, NULL, freq,

Thanks! This use of pos in the wpas_p2p_invite() call is just asking for
problems, so I fixed this in a bit more robust way (commit
54c61e6e08183472ffe2a07a067b3bd667a6473c) to avoid hitting similar
issues in the future if any new uses for pos gets added.
 
-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list