In if_iwx.c r1.63 / CVS commit ID QzTzJtyPl10L63Yi, I fixed a problem with
connecting to WPA1/TKIP networks. This change introduced a deference of
the 'ni' pointer passed to ic_set_key(). This pointer will be passed in
as NULL in certain situations, such as when WEP is used. Add the missing
NULL check.
reported by and fix tested by matthieu@
-/* $OpenBSD: if_iwx.c,v 1.151 2022/12/23 11:29:32 stsp Exp $ */
+/* $OpenBSD: if_iwx.c,v 1.152 2023/01/24 16:18:22 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
if (k->k_cipher != IEEE80211_CIPHER_CCMP) {
/* Fallback to software crypto for other ciphers. */
err = ieee80211_set_key(ic, ni, k);
- if (!err && (k->k_flags & IEEE80211_KEY_GROUP))
+ if (!err && in != NULL && (k->k_flags & IEEE80211_KEY_GROUP))
in->in_flags |= IWX_NODE_FLAG_HAVE_GROUP_KEY;
return err;
}