Browse Source

Verify that os_get_random() success for SA Query id

Jouni Malinen 15 years ago
parent
commit
f5455a2dbd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      hostapd/ctrl_iface.c

+ 2 - 2
hostapd/ctrl_iface.c

@@ -165,10 +165,10 @@ static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd,
 
 	wpa_printf(MSG_DEBUG, "CTRL_IFACE SA_QUERY %s", txtaddr);
 
-	if (hwaddr_aton(txtaddr, addr))
+	if (hwaddr_aton(txtaddr, addr) ||
+	    os_get_random(trans_id, WLAN_SA_QUERY_TR_ID_LEN) < 0)
 		return -1;
 
-	os_get_random(trans_id, WLAN_SA_QUERY_TR_ID_LEN);
 	ieee802_11_send_sa_query_req(hapd, addr, trans_id);
 
 	return 0;