From patchwork Thu Mar 7 09:12:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dvdspndl@gmail.com X-Patchwork-Id: 225769 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) by ozlabs.org (Postfix) with ESMTP id 7F2832C0365 for ; Thu, 7 Mar 2013 20:12:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E8C789C15A; Thu, 7 Mar 2013 04:12:15 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iIrVetkQ2N70; Thu, 7 Mar 2013 04:12:15 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B238E9C150; Thu, 7 Mar 2013 04:12:11 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 60D089C150 for ; Thu, 7 Mar 2013 04:12:10 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y0w33wQmWQps for ; Thu, 7 Mar 2013 04:12:05 -0500 (EST) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 552609C14D for ; Thu, 7 Mar 2013 04:12:05 -0500 (EST) Received: by mail-wg0-f48.google.com with SMTP id 16so307366wgi.3 for ; Thu, 07 Mar 2013 01:12:04 -0800 (PST) X-Received: by 10.194.242.163 with SMTP id wr3mr52403851wjc.35.1362647524266; Thu, 07 Mar 2013 01:12:04 -0800 (PST) Received: from localhost (93-172-33-149.bb.netvision.net.il. [93.172.33.149]) by mx.google.com with ESMTPS id eo1sm31877793wib.8.2013.03.07.01.12.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 07 Mar 2013 01:12:03 -0800 (PST) From: David Spinadel To: hostap@lists.shmoo.com Subject: [PATCH] wpa_supplicant: null pointer check before pmksa_cache_flush Date: Thu, 7 Mar 2013 11:12:01 +0200 Message-Id: <1362647521-8260-1-git-send-email-dvdspndl@gmail.com> X-Mailer: git-send-email 1.7.10.msysgit.1 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: David Spinadel Avoid segmentation fault in case of running wpa_supplicant w/o loaded driver. Signed-hostap: David Spinadel --- src/rsn_supp/wpa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index e50404c..3150dc3 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -2622,7 +2622,8 @@ void wpa_sm_update_replay_ctr(struct wpa_sm *sm, const u8 *replay_ctr) void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx) { #ifndef CONFIG_NO_WPA2 - pmksa_cache_flush(sm->pmksa, network_ctx); + if (sm) + pmksa_cache_flush(sm->pmksa, network_ctx); #endif /* CONFIG_NO_WPA2 */ }