[net80211] high oops on the high seas, or "god damnit compilers, it's 2016 and you're supposed to save me from this."

TODO:

* drink real coffee before committing in the morning, or there's a high
  risk of more obviously self-evident commits being turned into attempts
  at humour.

Reported by:	cem, Coverity CID 1366219
This commit is contained in:
Adrian Chadd 2016-11-22 17:36:16 +00:00
parent 134ede2dd2
commit 5899368a8a

View File

@ -241,7 +241,7 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen)
rxs = ieee80211_get_rx_params_ptr(m);
if ((rxs != NULL) & (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))
if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))
goto finish;
/*
@ -286,7 +286,7 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen)
/*
* Copy up 802.11 header and strip crypto bits.
*/
if (! ((rxs != NULL) & (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) {
if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) {
ovbcopy(mtod(m, void *), mtod(m, uint8_t *) + ccmp.ic_header,
hdrlen);
m_adj(m, ccmp.ic_header);
@ -295,13 +295,13 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen)
/*
* XXX TODO: see if MMIC_STRIP also covers CCMP MIC trailer.
*/
if (! ((rxs != NULL) & (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP)))
if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP)))
m_adj(m, -ccmp.ic_trailer);
/*
* Ok to update rsc now.
*/
if (! ((rxs != NULL) & (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) {
if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) {
k->wk_keyrsc[tid] = pn;
}