Filter input parameters in p2p_serv_disc_external

Submitted by Grzegorz Bajorski on March 2, 2012, 10:37 a.m.

Details

Message ID 4F50A2E2.6090006@tieto.com
State Accepted
Commit 28ef705d2df8002ef1c69a0089cd493f41c2157f
Headers show

Commit Message

Grzegorz Bajorski March 2, 2012, 10:37 a.m.
Hi

p2p_ctrl_serv_disc_external() can take only one parameters "0" or "1".

Change-Id: I999c575024bdf93736b56d0c7d5f3acc5e32791a
Signed-hostap: Grzegorz Bajorski <grzegorz.bajorski@tieto.com>
---
  wpa_supplicant/ctrl_iface.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

  }

Comments

Jouni Malinen March 5, 2012, 2:27 p.m.
On Fri, Mar 02, 2012 at 11:37:22AM +0100, Grzegorz Bajorski wrote:
> p2p_ctrl_serv_disc_external() can take only one parameters "0" or "1".

Thanks, applied.

Patch hide | download patch | download mbox

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index ac4009b..3c19421 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -2673,6 +2673,8 @@  static int p2p_ctrl_serv_disc_resp(struct 
wpa_supplicant *wpa_s, char *cmd)
  static int p2p_ctrl_serv_disc_external(struct wpa_supplicant *wpa_s,
  				       char *cmd)
  {
+	if (os_strcmp(cmd, "0") && os_strcmp(cmd, "1"))
+		return -1;
  	wpa_s->p2p_sd_over_ctrl_iface = atoi(cmd);
  	return 0;