From cb5ef952c843de4429b11e180f9e88b568460153 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 7 Sep 2014 18:27:42 +0300 Subject: [PATCH] SME: Verify that os_get_random() succeeds for SA Query Be more consistent on checking os_get_random() return value (CID 72706). Signed-off-by: Jouni Malinen --- wpa_supplicant/sme.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 5188b9f23..e4f2d123e 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -1318,7 +1318,10 @@ static void sme_sa_query_timer(void *eloop_ctx, void *timeout_ctx) wpa_s->sme.sa_query_trans_id = nbuf; wpa_s->sme.sa_query_count++; - os_get_random(trans_id, WLAN_SA_QUERY_TR_ID_LEN); + if (os_get_random(trans_id, WLAN_SA_QUERY_TR_ID_LEN) < 0) { + wpa_printf(MSG_DEBUG, "Could not generate SA Query ID"); + return; + } timeout = sa_query_retry_timeout; sec = ((timeout / 1000) * 1024) / 1000;