Patchwork Check WPA state machine for NULL in scan results processing

login
register
mail settings
Submitter Dmitry Shmidt
Date April 12, 2013, 11:14 p.m.
Message ID <20130412231633.03A4D13FDF2@ushik.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/236278/
State Rejected
Headers show

Comments

Dmitry Shmidt - April 12, 2013, 11:14 p.m.
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
---
 src/rsn_supp/preauth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Jouni Malinen - May 4, 2013, 1:58 p.m.
On Fri, Apr 12, 2013 at 04:14:13PM -0700, Dmitry Shmidt wrote:
> diff --git a/src/rsn_supp/preauth.c b/src/rsn_supp/preauth.c
> @@ -416,7 +416,7 @@ void pmksa_candidate_add(struct wpa_sm *sm, const u8 *bssid,
>  int rsn_preauth_scan_results(struct wpa_sm *sm)
>  {
> -	if (sm->ssid_len == 0)
> +	if (sm == NULL || sm->ssid_len == 0)
>  		return -1;

As pointed out in a separate email thread, this is not needed in
hostap.git and not the proper way of addressing the issue behind the
proposed change here. As such, I'm dropping this.

Patch

diff --git a/src/rsn_supp/preauth.c b/src/rsn_supp/preauth.c
index ab61867..f5138ed 100644
--- a/src/rsn_supp/preauth.c
+++ b/src/rsn_supp/preauth.c
@@ -416,7 +416,7 @@  void pmksa_candidate_add(struct wpa_sm *sm, const u8 *bssid,
  */
 int rsn_preauth_scan_results(struct wpa_sm *sm)
 {
-	if (sm->ssid_len == 0)
+	if (sm == NULL || sm->ssid_len == 0)
 		return -1;
 
 	/*